From 6a6b098f20fae6eea7f1c0aba565301e99a3ffaf Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 10 Sep 2019 09:31:27 +0200 Subject: [PATCH] rsync::site dependency cleanup, part 1 We define three things: a .service file, a .socket file, and a service. Previously, the service would require the two files, and the .socket file would also notify the service. Change that to the service subscribing to the files, so it gets a) applied after the files, and b) refreshed if either changes. This seems cleaner. The net change should be that the service gets also notified if the .service file changes. --- modules/rsync/manifests/site.pp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/rsync/manifests/site.pp b/modules/rsync/manifests/site.pp index c762d6d37..45836dfff 100644 --- a/modules/rsync/manifests/site.pp +++ b/modules/rsync/manifests/site.pp @@ -46,17 +46,14 @@ define rsync::site ( owner => 'root', group => 'root', mode => '0444', - notify => [ - Exec['systemctl daemon-reload'], - Service["rsyncd-${name}.socket"], - ], + notify => Exec['systemctl daemon-reload'], } service { "rsyncd-${name}.socket": ensure => $ensure_service, enable => $ensure_enable, - require => [ - Exec['systemctl daemon-reload'], + notify => Exec['systemctl daemon-reload'], + subscribe => [ File["/etc/systemd/system/rsyncd-${name}@.service"], File["/etc/systemd/system/rsyncd-${name}.socket"], ], -- 2.20.1