ArielGlenn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/381770 )
Change subject: move hardcoded refs to labstore hosts from dump manifests to profile ...................................................................... move hardcoded refs to labstore hosts from dump manifests to profile Bug: T175528 Change-Id: I446b53e2a900adae84dac2858e70078b71aa8bfd --- M modules/dumps/manifests/copying/labs.pp R modules/dumps/templates/copying/labs-rsync-cron.sh.erb M modules/profile/manifests/dumps/web/xmldumps_active.pp 3 files changed, 17 insertions(+), 10 deletions(-) Approvals: ArielGlenn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/dumps/manifests/copying/labs.pp b/modules/dumps/manifests/copying/labs.pp index 49dae51..320bfb0 100644 --- a/modules/dumps/manifests/copying/labs.pp +++ b/modules/dumps/manifests/copying/labs.pp @@ -1,4 +1,6 @@ -class dumps::copying::labs { +class dumps::copying::labs( + $labhost = undef, +) { file { '/usr/local/bin/wmfdumpsmirror.py': ensure => 'present', mode => '0755', @@ -6,9 +8,9 @@ } file{ '/usr/local/sbin/labs-rsync-cron.sh': - ensure => 'present', - mode => '0755', - source => 'puppet:///modules/dumps/copying/labs-rsync-cron.sh', + ensure => 'present', + mode => '0755', + content => template('dumps/copying/labs-rsync-cron.sh.erb'), } cron { 'dumps_labs_rsync': @@ -16,7 +18,7 @@ user => 'root', minute => '50', hour => '3', - command => '/usr/local/sbin/labs-rsync-cron.sh', + command => "/usr/local/sbin/labs-rsync-cron.sh ${labhost}", environment => 'MAILTO=ops-du...@wikimedia.org', require => File['/usr/local/bin/wmfdumpsmirror.py', '/usr/local/sbin/labs-rsync-cron.sh'], diff --git a/modules/dumps/files/copying/labs-rsync-cron.sh b/modules/dumps/templates/copying/labs-rsync-cron.sh.erb similarity index 65% rename from modules/dumps/files/copying/labs-rsync-cron.sh rename to modules/dumps/templates/copying/labs-rsync-cron.sh.erb index 9bea698..cb975ac 100755 --- a/modules/dumps/files/copying/labs-rsync-cron.sh +++ b/modules/dumps/templates/copying/labs-rsync-cron.sh.erb @@ -1,10 +1,9 @@ #!/bin/bash ######################################### # This file is managed by puppet! -# puppet:///modules/dumps/copying/labs-rsync-cron.sh +# puppet:///modules/dumps/copying/labs-rsync-cron.sh.erb ######################################### -desthost="labstore1003.eqiad.wmnet" otherdir="/data/xmldatadumps/public/other" bwlimit="--bwlimit=50000" @@ -18,10 +17,16 @@ fi } +if [ -z "$1" ]; then + echo "Usage: $0 hostname" + exit 1 +fi -running=`pgrep -u root -f "python /usr/local/bin/wmfdumpsmirror.py --dest_hostname labstore1003.eqiad.wmnet"` +desthost="$1" + +running=`pgrep -u root -f "python /usr/local/bin/wmfdumpsmirror.py --dest_hostname ${desthost}"` if [ -z "$running" ]; then - python /usr/local/bin/wmfdumpsmirror.py --dest_hostname labstore1003.eqiad.wmnet --sourcedir /data/xmldatadumps/public --destdir dumps/public --filesperjob 50 --sizeperjob 5G --workercount 1 --rsynclist rsync-filelist-last-3-good.txt.rsync --rsyncargs -rlptqgo,--bwlimit=50000 + python /usr/local/bin/wmfdumpsmirror.py --dest_hostname ${desthost} --sourcedir /data/xmldatadumps/public --destdir dumps/public --filesperjob 50 --sizeperjob 5G --workercount 1 --rsynclist rsync-filelist-last-3-good.txt.rsync --rsyncargs -rlptqgo,--bwlimit=50000 fi # fixme need to ensure ${desthost}::dumps/public/wikidatawiki/entities/ exists diff --git a/modules/profile/manifests/dumps/web/xmldumps_active.pp b/modules/profile/manifests/dumps/web/xmldumps_active.pp index 5cacabe..440d9cf 100644 --- a/modules/profile/manifests/dumps/web/xmldumps_active.pp +++ b/modules/profile/manifests/dumps/web/xmldumps_active.pp @@ -10,5 +10,5 @@ } # copy dumps and other datasets to fallback host(s) and to labs class {'::dumps::copying::peers':} - class {'::dumps::copying::labs':} + class {'::dumps::copying::labs': labhost => 'labstore1003.eqiad.wmnet'} } -- To view, visit https://gerrit.wikimedia.org/r/381770 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I446b53e2a900adae84dac2858e70078b71aa8bfd Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: ArielGlenn <ar...@wikimedia.org> Gerrit-Reviewer: ArielGlenn <ar...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits