From 068bc8d4127f14ae0faea0068d34e86cbbe1b484 Mon Sep 17 00:00:00 2001 From: Adam Henry Lewenberg <adamhl@stanford.edu> Date: Sat, 12 Sep 2015 06:51:02 -0700 Subject: [PATCH] add new systemd class --- NEWS | 6 ++++-- manifests/systemd.pp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 manifests/systemd.pp diff --git a/NEWS b/NEWS index 36d581e..4c483fa 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,11 @@ Unreleased - [dns] Changes Livermore detection to use the system's primary IP address, + [systemd] New class to allow systemd daemon reloads. (adamhl) + + [dns] Changes Livermore detection to use the system's primary IP address, instead of using a manually-set parameter. (akkornel) - [kerberos] Automatically determine if we are in Livermore; if we are, place + [kerberos] Automatically determine if we are in Livermore; if we are, place the Livermore-based KDC at the top of the list. (akkornel) Clients who are using the base::kerberos::dr class should immediately switch diff --git a/manifests/systemd.pp b/manifests/systemd.pp new file mode 100644 index 0000000..604e875 --- /dev/null +++ b/manifests/systemd.pp @@ -0,0 +1,32 @@ +# This code is from the Puppet Forge project justin8-systemd +# +# If you want to reload the systemd service on a unit file change, include +# this class and add a dependency: +# +# notify => Exec['systemd-daemon-reload'] +# + +class systemd { + + exec { 'systemd-daemon-reload': + path => '/bin:/usr/bin:/sbin:/usr/sbin', + command => 'systemctl daemon-reload', + refreshonly => true, + } + + case $::osfamily { + 'Archlinux': { + $unit_path = '/usr/lib/systemd/system' + } + 'Debian': { + $unit_path = '/lib/systemd/system' + } + 'RedHat': { + $unit_path = '/usr/lib/systemd/system' + } + default: { + $unit_path = '/usr/lib/systemd/system' + } + } + +} -- GitLab