Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/57854


Change subject: Puppetize scap-1 and scap-2 scripts
......................................................................

Puppetize scap-1 and scap-2 scripts

I looked around and couldn't find an existing patch-set for these
scripts. For this patch, I copied the files from fenari and committed
them without modification.

Change-Id: I33d93347f811906f37d503039af7035d122938b9
---
A files/scap/scap-1
A files/scap/scap-2
M manifests/misc/deployment.pp
3 files changed, 63 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/54/57854/1

diff --git a/files/scap/scap-1 b/files/scap/scap-1
new file mode 100755
index 0000000..0e6cdc7
--- /dev/null
+++ b/files/scap/scap-1
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+if [ ! -d /usr/local/apache/common-local ];then
+       if ! install -d -o mwdeploy -g mwdeploy /usr/local/apache/common-local; 
then
+               echo "Unable to create common-local, please re-run this script 
as root."
+               exit 1
+       fi
+fi
+
+if [ ! -d /usr/local/apache/uncommon ];then
+       if ! install -d -o mwdeploy -g mwdeploy /usr/local/apache/uncommon; then
+               echo "Unable to create /usr/local/apache/uncommon, please 
re-run this script as root."
+               exit 1
+       fi
+fi
+
+RSYNC_SERVERS="$1"
+SERVER=
+if [ -n "$RSYNC_SERVERS" ]; then
+       SERVER=$(sudo /usr/bin/find-nearest-rsync $RSYNC_SERVERS)
+fi
+if [ -z "$SERVER" ]; then
+       SERVER=10.0.5.8
+fi
+
+sudo -u mwdeploy /usr/bin/scap-2 "$SERVER"
+
+echo Done
+
diff --git a/files/scap/scap-2 b/files/scap/scap-2
new file mode 100755
index 0000000..813b3d7
--- /dev/null
+++ b/files/scap/scap-2
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:
+TERM=dumb
+
+SERVER="$1"
+if [ -z "$SERVER" ]; then
+       SERVER=10.0.5.8
+fi
+
+echo -n Copying to `hostname -s` from "$SERVER"...
+if rsync -a --delete \
+       --exclude=**/.svn/lock \
+       --exclude=**/.git/objects \
+       --exclude=**/.git/**/objects \
+       --no-perms \
+       "$SERVER"::common/ /usr/local/apache/common-local
+then
+       echo "ok"
+else
+       echo "failed"
+       exit 1
+fi
+
diff --git a/manifests/misc/deployment.pp b/manifests/misc/deployment.pp
index 9b6ccf2..99bbeaf 100644
--- a/manifests/misc/deployment.pp
+++ b/manifests/misc/deployment.pp
@@ -183,6 +183,16 @@
                        group => root,
                        mode => 0555,
                        source => "puppet:///files/scap/scap";
+               "${scriptpath}/scap-1":
+                       owner => root,
+                       group => root,
+                       mode => 0555,
+                       source => "puppet:///files/scap/scap-1";
+               "${scriptpath}/scap-2":
+                       owner => root,
+                       group => root,
+                       mode => 0555,
+                       source => "puppet:///files/scap/scap-2";
                "${scriptpath}/sync-common-all":
                        owner => root,
                        group => root,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33d93347f811906f37d503039af7035d122938b9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

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

Reply via email to