Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/56885
Change subject: Eliminate unnecessary apache restarts in Puppet runs
......................................................................
Eliminate unnecessary apache restarts in Puppet runs
This change corrects the unless / onlyif checks for apache::mod and
apache::site resources.
Change-Id: I7737026e119546262d6ae92566c8cf8893d22a55
---
M puppet/modules/apache/manifests/mod.pp
M puppet/modules/apache/manifests/site.pp
2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
refs/changes/85/56885/1
diff --git a/puppet/modules/apache/manifests/mod.pp
b/puppet/modules/apache/manifests/mod.pp
index c1324a9..436e06a 100644
--- a/puppet/modules/apache/manifests/mod.pp
+++ b/puppet/modules/apache/manifests/mod.pp
@@ -7,14 +7,14 @@
case $ensure {
present: {
exec { "/usr/sbin/a2enmod ${mod}":
- unless => 'test -f
/etc/apache2/mods-enabled/${mod}.load',
+ unless => "test -f
/etc/apache2/mods-enabled/${mod}.load",
require => Package['apache2'],
notify => Exec['reload-apache2'],
}
}
absent: {
exec { "/usr/sbin/a2dismod ${mod}":
- onlyif => 'test -f
/etc/apache2/mods-enabled/${mod}.load',
+ onlyif => "test -f
/etc/apache2/mods-enabled/${mod}.load",
require => Package['apache2'],
notify => Exec['reload-apache2'],
}
diff --git a/puppet/modules/apache/manifests/site.pp
b/puppet/modules/apache/manifests/site.pp
index c864017..2f77874 100644
--- a/puppet/modules/apache/manifests/site.pp
+++ b/puppet/modules/apache/manifests/site.pp
@@ -14,16 +14,16 @@
}
}
exec { "/usr/sbin/a2ensite -qf ${site}":
- returns => [0, 1],
require => Package['apache2'],
notify => Exec['reload-apache2'],
+ unless => "a2dissite <<<'' | head -1 | cut -c
19- | grep -w ${site}"
}
}
absent: {
exec { "/usr/sbin/a2dissite -qf ${site}":
- returns => [0, 1],
require => Package['apache2'],
notify => Exec['reload-apache2'],
+ onlyif => "a2dissite <<<'' | head -1 | cut -c
19- | grep -w ${site}"
}
}
}
--
To view, visit https://gerrit.wikimedia.org/r/56885
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7737026e119546262d6ae92566c8cf8893d22a55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits