Ori.livneh has submitted this change and it was merged.

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(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



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: merged
Gerrit-Change-Id: I7737026e119546262d6ae92566c8cf8893d22a55
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to