Skip to content

Commit 4989f36

Browse files
authored
Merge pull request #288 from traylenator/templated
New systemd::manage_unit, systemd::manage_dropin types
2 parents d9d99c3 + ec9355d commit 4989f36

File tree

15 files changed

+1050
-0
lines changed

15 files changed

+1050
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ systemd::unit_file { 'foo.service':
5959
}
6060
```
6161

62+
### unit files from parameters
63+
64+
Create a unit file from parameters
65+
66+
```puppet
67+
systemd::manage_unit { 'myrunner.service':
68+
$unit_entry => {
69+
'Description' => 'My great service',
70+
},
71+
$service_entry => {
72+
'Type' => 'oneshot',
73+
'ExecStart' => '/usr/bin/doit.sh',
74+
},
75+
$install_entry => {
76+
'WantedBy' => 'multi-user.target',
77+
},
78+
enable => true,
79+
active => true,
80+
}
81+
```
82+
83+
The parameters `unit_entry`, `service_entry` and `install_entry` populate the
84+
`[Unit]`, `[Service]` and `[Install]` sections of the generated unit file.
85+
6286
### drop-in files
6387

6488
Drop-in files are used to add or alter settings of a unit without modifying the
@@ -105,6 +129,21 @@ systemd::dropin_files:
105129
source: puppet:///modules/${module_name}/foo.conf
106130
```
107131
132+
### drop-in files from parameters
133+
134+
```puppet
135+
systemd::manage_dropin { 'myconf.conf':
136+
ensure => present,
137+
unit => 'myservice.service',
138+
service_entry => {
139+
'Type' => 'oneshot',
140+
'ExecStart' => ['', '/usr/bin/doit.sh'],
141+
},
142+
}
143+
```
144+
145+
The filename of the drop in. The full path is determined using the path, unit and this filename.
146+
108147
### modules-load.d
109148

110149
Create a file entry for modules-loads directory and start

0 commit comments

Comments
 (0)