Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: puppet-compiler: correctly refresh prod hiera config on every 
run
......................................................................

puppet-compiler: correctly refresh prod hiera config on every run

Change-Id: I68f58dde5bf8dcaa2805f3d371062d47251d1b00
---
M compare-puppet-catalogs/shell/helper
1 file changed, 16 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/89/192289/1

diff --git a/compare-puppet-catalogs/shell/helper 
b/compare-puppet-catalogs/shell/helper
index 087085d..0dfa140 100755
--- a/compare-puppet-catalogs/shell/helper
+++ b/compare-puppet-catalogs/shell/helper
@@ -47,12 +47,8 @@
 
 function setup_change() {
     test -d ${PROD_DIR}/puppet || ( echo "Could not find the original install" 
&& exit 1)
-    pushd ${PROD_DIR}/puppet
-    #ensure the prod branch is up to date
-    log "Updating the production repository"
-    git pull --rebase
-    popd
     pushd ${EXTDIR}
+    refresh_prod
     rsync -avz --delete ${PROD_DIR}/puppet .
     test -d var || ln -s ${PROD_DIR}/var var
     if [ ! -d etc ]; then
@@ -63,6 +59,19 @@
     update_change
 }
 
+function refresh_prod() {
+    PROD_PUPPET=${PROD_DIR}/puppet
+    pushd ${PROD_PUPPET}
+    #ensure the prod branch is up to date
+    log "Updating the production repository"
+    git pull --rebase
+    popd
+    HIERADATA_PROD_DIR=${PROD_PUPPET}/hieradata
+    
HIERA_PROD_FILE=${PROD_PUPPET}/modules/puppetmaster/files/production.hiera.yaml
+    sed s,/etc/puppet/hieradata,${HIERADATA_DIR}, ${HIERA_PROD_FILE} | \
+        sed s,/etc/puppet/private,${PRIVATEDIR}, -  > 
${PROD_DIR}/etc/hiera.yaml
+}
+
 function copy_hiera() {
     if [ -f ${HIERA_CONFIG_FILE} ]; then
         HIERADATA_DIR=${PUPPETDIR}/hieradata
@@ -72,6 +81,8 @@
     fi;
 }
 
+
+
 function checkout() {
     log "Checking out repositories"
     pushd ${EXTDIR}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68f58dde5bf8dcaa2805f3d371062d47251d1b00
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org>

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

Reply via email to