Skip to content

Commit

Permalink
Do a daemon reload for static units
Browse files Browse the repository at this point in the history
Services that are deployed by systemd::timer need to trigger a
`systemctl daemon-reload` when the .service file is changed.

  systemd::timer { 'foo.timer':
    timer_content   => $foo_timer,
    service_content => $foo_service,
    active          => true,
    enable          => true,
  }

results in a foo.service that is neither active nor enabled. It is
a "static" unit that will be triggered by the foo.timer alone. This
fixes voxpupuli#190 and more specifically:

voxpupuli#190 (comment)

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jun 16, 2021
1 parent f184b62 commit e4907f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifests/unit_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@
} else {
File["${path}/${name}"] ~> Service[$name]
}
} elsif $ensure == 'absent' {
} else {
# Work around https://tickets.puppetlabs.com/browse/PUP-9473
# and react to changes on static unit files (ie: .service triggered by .timer)
exec { "${name}-systemctl-daemon-reload":
command => 'systemctl daemon-reload',
refreshonly => true,
Expand Down

0 comments on commit e4907f1

Please sign in to comment.