Giuseppe Lavagetto has uploaded a new change for review. https://gerrit.wikimedia.org/r/172967
Change subject: varnish: make varnish::instance not depend on ganglia ...................................................................... varnish: make varnish::instance not depend on ganglia We may have situations where we don't have either ganglia or gmond, so we don't want to have varnish::instance depend on it; also, the new syntax using the spaceship operator and tags should be easier to read and maintain. This is a prerequisite to fix bug #73263 Change-Id: I6ebf100e64cb432bb073831131c6be62dfac5695 Signed-off-by: Giuseppe Lavagetto <[email protected]> --- M modules/varnish/manifests/instance.pp M modules/varnish/manifests/monitoring/ganglia.pp 2 files changed, 6 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/67/172967/1 diff --git a/modules/varnish/manifests/instance.pp b/modules/varnish/manifests/instance.pp index d58b719..1193ddd 100644 --- a/modules/varnish/manifests/instance.pp +++ b/modules/varnish/manifests/instance.pp @@ -86,7 +86,7 @@ hasstatus => false, pattern => "/var/run/varnishd${instancesuffix}.pid", subscribe => Package['varnish'], - before => Exec['generate varnish.pyconf'], + tag => 'varnish_instance' } # This mechanism with the touch/rm conditionals in the pair of execs @@ -120,14 +120,5 @@ monitor_service { "varnish http ${title}": description => "Varnish HTTP ${title}", check_command => "check_http_generic!varnishcheck!${port}" - } - - # Restart gmond if this varnish instance has been (re)started later - # than gmond was started - exec { "restart gmond for varnish${instancesuffix}": - path => '/bin:/usr/bin', - command => 'true', - onlyif => "test /var/run/varnishd${instancesuffix}.pid -nt /var/run/gmond.pid", - notify => Service['gmond'], } } diff --git a/modules/varnish/manifests/monitoring/ganglia.pp b/modules/varnish/manifests/monitoring/ganglia.pp index f634b9e..0ff168d 100644 --- a/modules/varnish/manifests/monitoring/ganglia.pp +++ b/modules/varnish/manifests/monitoring/ganglia.pp @@ -25,5 +25,10 @@ notify => Service['gmond'], } + # Dependencies + # Exec the config generation AFTER all varnish instances have started + Service <| tag == 'varnish_instance' |> -> Exec['generate varnish.pyconf'] + # Restart gmond if one varnish instance has been refreshed + Service <| tag == 'varnish_instance' |> ~> Service['gmond'] Exec['generate varnish.pyconf'] -> Exec['replace varnish.pyconf'] } -- To view, visit https://gerrit.wikimedia.org/r/172967 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ebf100e64cb432bb073831131c6be62dfac5695 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
