Dzahn has submitted this change and it was merged.

Change subject: re-add apache-graceful-all with some fixes
......................................................................


re-add apache-graceful-all with some fixes

re-adding after it got deleted in I784a16df70
re-applying changes from Ib7bc824944

(i agree it shouldn't have been in puppet twice,
but not with just deleting them both without a
replacement. and not changing the docs or the
fenari version before it was tested on tin was on purpose)

- replaced ddsh with dsh because that was a link
  that doesn't exist on tin

- replaced the /etc/cluster check with eqiad,
  unless we're not going to have /etc/cluster anymore

- apache-sanity check not removed just yet, because it
  does fail for some servers but not the ones actually
  active in pybal (apache-fast-test result with the
  pybal option shows all servers that are active actually
  did get graceful'ed besides the errors on others)

- remove the whole "check for home-mounted Apaches" part

- add /etc/cluster to be created with site name in it,
  just like it did on fenari

Change-Id: I4d1b3647655578e402c5cd30459c73e70c2072f3
---
A modules/apachesync/files/apache-graceful-all
M modules/apachesync/manifests/init.pp
2 files changed, 22 insertions(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/apachesync/files/apache-graceful-all 
b/modules/apachesync/files/apache-graceful-all
new file mode 100755
index 0000000..89160d9
--- /dev/null
+++ b/modules/apachesync/files/apache-graceful-all
@@ -0,0 +1,10 @@
+#!/bin/bash
+if [ `cat /etc/cluster` == eqiad ]; then
+       /usr/local/bin/dologmsg "$USER is doing a graceful restart of all 
apaches"
+fi
+
+dsh -F20 -g apaches -cM '/usr/bin/apache-sanity-check && sudo 
/usr/sbin/apache2ctl graceful'
+
+if [ `cat /etc/cluster` == eqiad ]; then
+       /usr/local/bin/dologmsg "!log $USER gracefulled all apaches"
+fi
diff --git a/modules/apachesync/manifests/init.pp 
b/modules/apachesync/manifests/init.pp
index 8e8eb5e..1a85deb 100644
--- a/modules/apachesync/manifests/init.pp
+++ b/modules/apachesync/manifests/init.pp
@@ -1,6 +1,14 @@
 # scripts for syncing apache changes
 class apachesync {
 
+
+    file { '/etc/cluster':
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        content => $::site,
+    }
+
     file { '/usr/local/bin/sync-apache':
         owner  => 'root',
         group  => 'root',
@@ -9,7 +17,10 @@
     }
 
     file { '/usr/local/bin/apache-graceful-all':
-        ensure => absent,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0555',
+        source => 'puppet:///modules/apachesync/apache-graceful-all',
     }
 
     file { '/usr/local/bin/sync-apache-simulated':

-- 
To view, visit https://gerrit.wikimedia.org/r/132011
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d1b3647655578e402c5cd30459c73e70c2072f3
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: ArielGlenn <ar...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to