From 6e26c8ec0e0596c33381a4112b87aa90190af090 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 17 Jul 2017 15:09:59 +0200 Subject: [PATCH] only notify service if defined --- modules/systemd/manifests/override.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/systemd/manifests/override.pp b/modules/systemd/manifests/override.pp index 8ffee48d8..117b16ea9 100644 --- a/modules/systemd/manifests/override.pp +++ b/modules/systemd/manifests/override.pp @@ -25,12 +25,16 @@ define systemd::override ( ] } } elsif $source { + if defined(Service["${name}"]) { + $notify = [ Exec['systemctl daemon-reload'], Service["${name}"] ] + } else { + $notify = [ Exec['systemctl daemon-reload'] ] + } + file { "${dest}": ensure => $ensure, source => $source, - notify => [ Exec['systemctl daemon-reload'], - Service["${name}"], - ] + notify => $notify, } } } -- 2.20.1