ArielGlenn has uploaded a new change for review.

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

Change subject: add hiera config settings for old snapshot hosts
......................................................................

add hiera config settings for old snapshot hosts

also provide the dumps cron job script with a fallback if it
doesn't find the script directory, and don't run at all if the
specified runtype is 'none'

Change-Id: I8664eb0f04e3f92214ae516835f411284c5e0d98
---
M hieradata/hosts/snapshot1001.yaml
M hieradata/hosts/snapshot1002.yaml
A hieradata/hosts/snapshot1003.yaml
A hieradata/hosts/snapshot1004.yaml
M modules/snapshot/templates/dumps/fulldumps.sh.erb
5 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/59/281659/1

diff --git a/hieradata/hosts/snapshot1001.yaml 
b/hieradata/hosts/snapshot1001.yaml
index a5932da..1839ba7 100644
--- a/hieradata/hosts/snapshot1001.yaml
+++ b/hieradata/hosts/snapshot1001.yaml
@@ -1 +1,4 @@
 snapshot::dumps::hugewikis: true
+snapshot::dumps::runtype: hugewikis
+snapshot::dumps::maxjobs: 28
+snapshot::cron::misc: false
diff --git a/hieradata/hosts/snapshot1002.yaml 
b/hieradata/hosts/snapshot1002.yaml
index c8ed252..0ff8fa9 100644
--- a/hieradata/hosts/snapshot1002.yaml
+++ b/hieradata/hosts/snapshot1002.yaml
@@ -1,3 +1,6 @@
 debdeploy::grains:
   debdeploy-snapshot:
     value: canary
+snapshot::dumps::runtype: regular
+snapshot::dumps::maxjobs: 8
+snapshot::cron::misc: false
diff --git a/hieradata/hosts/snapshot1003.yaml 
b/hieradata/hosts/snapshot1003.yaml
new file mode 100644
index 0000000..ec87add
--- /dev/null
+++ b/hieradata/hosts/snapshot1003.yaml
@@ -0,0 +1,3 @@
+snapshot::dumps::runtype: none
+snapshot::dumps::maxjobs: 0
+snapshot::cron::misc: true
diff --git a/hieradata/hosts/snapshot1004.yaml 
b/hieradata/hosts/snapshot1004.yaml
new file mode 100644
index 0000000..85b2087
--- /dev/null
+++ b/hieradata/hosts/snapshot1004.yaml
@@ -0,0 +1,3 @@
+snapshot::dumps::runtype: regular
+snapshot::dumps::maxjobs: 8
+snapshot::cron::misc: false
diff --git a/modules/snapshot/templates/dumps/fulldumps.sh.erb 
b/modules/snapshot/templates/dumps/fulldumps.sh.erb
index a36fb3a..cbaf615 100644
--- a/modules/snapshot/templates/dumps/fulldumps.sh.erb
+++ b/modules/snapshot/templates/dumps/fulldumps.sh.erb
@@ -91,6 +91,10 @@
 startdate_yyyymmdd="${yearmonth}${startdate}"
 enddate="$2"
 wikitype="$3"
+if [ "$wikitype" == 'none' ]; then
+    # do nothing
+    exit 0
+fi
 
 if [ "$4" == "dryrun" ]; then
     dryrun=1
@@ -118,6 +122,10 @@
 
 dumpsdir="<%= scope.lookupvar('snapshot::dumps::dirs::dumpsdir') %>"
 repodir="<%= scope.lookupvar('snapshot::dumps::dirs::repodir') %>"
+if [ -z "$repodir" ]; then
+    #fallback
+    repodir="/srv/dumps"
+fi
 cd $repodir
 
 today=`/bin/date +%d`

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8664eb0f04e3f92214ae516835f411284c5e0d98
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <[email protected]>

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

Reply via email to