BBlack has submitted this change and it was merged. Change subject: varnish: ability to remove a named instance ......................................................................
varnish: ability to remove a named instance Bug: T119396 Change-Id: I48102ab771202319a8b8622eb688bd1220bdf003 --- A modules/varnish/manifests/remove_instance.pp 1 file changed, 37 insertions(+), 0 deletions(-) Approvals: BBlack: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/varnish/manifests/remove_instance.pp b/modules/varnish/manifests/remove_instance.pp new file mode 100644 index 0000000..abdc505 --- /dev/null +++ b/modules/varnish/manifests/remove_instance.pp @@ -0,0 +1,37 @@ +# Ensures any varnish daemon instance with the given suffix (blank +# for default/unnamed) is stopped and unconfigured before any +# defined varnish::instance is configured and/or started. + +define varnish::remove_instance() { + require varnish::common + + $suffix = $title + + exec { "stop-varnish${suffix}": + user => 'root', + path => '/usr/sbin:/sbin:/usr/bin:/bin', + command => "service varnish${suffix} stop", + onlyif => "service varnish${suffix} status", + } + + $initfiles = [ + "/etc/init.d/varnish${suffix}", + "/etc/systemd/system/varnish${suffix}.service", + "/lib/systemd/system/varnish${suffix}.service", + ] + + file { $initfiles: + ensure => absent, + require => Exec["stop-varnish${suffix}"], + notify => Exec["systemctl-reload-vi${suffix}"], + } + + exec { "systemctl-reload-vi${suffix}": + user => 'root', + path => '/usr/sbin:/sbin:/usr/bin:/bin', + command => 'systemctl daemon-reload', + refreshonly => true, + } + + Varnish::Remove_instance <| |> -> Varnish::Instance <| |> +} -- To view, visit https://gerrit.wikimedia.org/r/256259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48102ab771202319a8b8622eb688bd1220bdf003 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits