Skip to content

Commit

Permalink
Link the unit file to /dev/null when "enable => mask"
Browse files Browse the repository at this point in the history
Fixes voxpupuli#188

Signed-off-by: Simon Deziel <simon@sdeziel.info>
  • Loading branch information
simondeziel committed Nov 6, 2021
1 parent adcf815 commit 63499f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/unit_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@

assert_type(Systemd::Unit, $name)

if $target {
if $enable == 'mask' {
$_target = '/dev/null'
} else {
$_target = $target
}

if $_target {
$_ensure = 'link'
} else {
$_ensure = $ensure ? {
Expand All @@ -80,7 +86,7 @@
ensure => $_ensure,
content => $content,
source => $source,
target => $target,
target => $_target,
owner => $owner,
group => $group,
mode => $mode,
Expand Down

0 comments on commit 63499f5

Please sign in to comment.