From: Peter Palfrader Date: Fri, 6 Oct 2017 08:23:48 +0000 (+0200) Subject: Add a systemd::mask X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=41cda7b2ada814d3d8c9d0b32ce34029a95f2da1;p=mirror%2Fdsa-puppet.git Add a systemd::mask --- diff --git a/modules/systemd/manifests/mask.pp b/modules/systemd/manifests/mask.pp new file mode 100644 index 000000000..75a1a4334 --- /dev/null +++ b/modules/systemd/manifests/mask.pp @@ -0,0 +1,21 @@ +define systemd::mask ( + $ensure = present, + ) { + $filename = "/etc/systemd/system/${name}" + + case $ensure { + present: { + $linkensure = "link" + } + absent: { + $linkensure = "absent" + } + default: { fail ( "Unknown ensure value: '$ensure'" ) } + } + + file { $filename: + ensure => $linkensure, + target => '/dev/null', + notify => Exec['systemctl daemon-reload'], + } +}