Add systemd module
This commit is contained in:
parent
8312944a50
commit
2ee1299f2e
1 changed files with 35 additions and 0 deletions
35
systemd/manifests/init.pp
Normal file
35
systemd/manifests/init.pp
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Common class for systemd.
|
||||
#
|
||||
class systemd {
|
||||
|
||||
exec { 'systemctl daemon-reload':
|
||||
refreshonly => true,
|
||||
command => $::operatingsystem ? {
|
||||
'ubuntu' => '/bin/systemctl daemon-reload',
|
||||
default => '/usr/bin/systemctl daemon-reload',
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install systemd unit file.
|
||||
#
|
||||
define systemd::unit(
|
||||
$content=undef,
|
||||
$source=undef,
|
||||
) {
|
||||
|
||||
include systemd
|
||||
|
||||
file { "/etc/systemd/system/${name}":
|
||||
ensure => present,
|
||||
mode => '0644',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
content => $content,
|
||||
source => $source,
|
||||
notify => Exec['systemctl daemon-reload'],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue