From a8d6b5f8e17c703be63efc064dbb2c83a8e9e719 Mon Sep 17 00:00:00 2001 From: Leap Admins Date: Sun, 5 May 2013 07:24:15 +0000 Subject: SERVICES -> NODES, updated for newest leap_cli output --- leap-add-nodes.sh | 2 +- leap-bootstrap-all.sh | 2 +- leap-bootstrap-node.sh | 1 + leap-deploy-node.sh | 10 ++++++---- leap-reset-deploy-all.sh | 31 +++++++++++++++++++------------ platform-test.cfg.example | 2 +- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/leap-add-nodes.sh b/leap-add-nodes.sh index 5e4d18a..5143b94 100755 --- a/leap-add-nodes.sh +++ b/leap-add-nodes.sh @@ -4,7 +4,7 @@ cd $ROOTDIR/$PROVIDER -for i in $SERVICES +for i in $NODES do case $i in openvpn) diff --git a/leap-bootstrap-all.sh b/leap-bootstrap-all.sh index b0d2659..a42df27 100755 --- a/leap-bootstrap-all.sh +++ b/leap-bootstrap-all.sh @@ -3,7 +3,7 @@ . /etc/leap/platform-test.cfg -for i in $SERVICES +for i in $NODES do $PLATFORM_TEST_BIN/leap-bootstrap-node.sh $i done diff --git a/leap-bootstrap-node.sh b/leap-bootstrap-node.sh index b3649d2..c5fd05b 100755 --- a/leap-bootstrap-node.sh +++ b/leap-bootstrap-node.sh @@ -9,6 +9,7 @@ cd $PROVIDERDIR vm=$1 leap $OPTS local start $vm +sleep 20 leap $OPTS node init $vm # set hostname + do dist-upgrade leap $OPTS deploy $vm --tags site_apt::dist_upgrade,site_config::hosts diff --git a/leap-deploy-node.sh b/leap-deploy-node.sh index b24e1ee..039f635 100755 --- a/leap-deploy-node.sh +++ b/leap-deploy-node.sh @@ -15,8 +15,8 @@ RMCOLORS='s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' # we need to deploy with verbose level 2, and filter out unwanted stuff # until puppet errors show up in verbose level 0 +1 (#1750) -FILTER_CLI='= read|= loading|= no change| - executing| = executing| = applying| = ran git| = checking| = synching| = skipping file_path| - rsync| - hiera| - cd /root/| - rolling backexecuting| - files/ca/client_ca.crt' -FILTER_PUPPET='] notice: | - Puppet apply complete.|] warning: Dynamic lookup|] warning: Scope\(Class' +FILTER_CLI='= read|= loading|= no change| - executing| = executing| = applying| = ran git| = checking| = synching| = skipping file_path| - cd .*; rsync -a| - hiera| = created hiera/| - cd /root/| - rolling backexecuting| - files/ca/client_ca.crt|\[bin,puppet\] ->' +FILTER_PUPPET='] notice: |] No change to hostname|] Puppet apply complete|] warning: Dynamic lookup|] warning: Scope\(Class' FILTER_ALL="($FILTER_CLI|$FILTER_PUPPET)" @@ -29,11 +29,13 @@ if [ $? -eq 0 ] then msg="From: $MAIL_FROM\nTo: $MAIL_TO\nSubject: Deploy to \"$vm\" had errors !\n\n`cat $ERRLOG`" echo "Deploy to \"$vm\" on `date` had errors." | tee -a $LOG - echo "Sending this mail:" echo cat $ERRLOG - printf "$msg" | sendmail -t + if [ "$MAIL_TO" != '' ]; then + echo "Sending this mail to $MAIL_TO:" + printf "$msg" | sendmail -t + fi else echo "Deploy to $vm on `date` went fine."| tee -a $LOG diff --git a/leap-reset-deploy-all.sh b/leap-reset-deploy-all.sh index 7a35772..43e3e34 100755 --- a/leap-reset-deploy-all.sh +++ b/leap-reset-deploy-all.sh @@ -1,23 +1,30 @@ #!/bin/sh -. /etc/leap/platform-test.cfg +reset_nodes () { + leap clean + leap compile + leap local reset +} + +deploy_nodes () { + for i in $NODES + do + $PLATFORM_TEST_BIN/leap-deploy-node.sh $i & + done +} +. /etc/leap/platform-test.cfg cd $ROOTDIR/$PROVIDER echo echo "Starting $0 on `date`" -leap clean -leap compile -leap local reset -for i in $SERVICES -do - $PLATFORM_TEST_BIN/leap-deploy-node.sh $i & -done +echo "Starting reset_nodes on `date`" +reset_nodes +sleep 20 + +echo "Starting deploy_nodes as background tasks on `date`" +deploy_nodes -#doesn't make sense if deploying parallel -#echo -#echo "Finished $0 on `date`" - diff --git a/platform-test.cfg.example b/platform-test.cfg.example index d4efdcc..a34927a 100644 --- a/platform-test.cfg.example +++ b/platform-test.cfg.example @@ -1,7 +1,7 @@ PROVIDER='example' ROOTDIR='/root/platform-testing' PROVIDERDIR=$ROOTDIR/$PROVIDER -SERVICES='ca couchdb monitor openvpn tor webapp' +NODES='couch1 couch2 monitor openvpn tor webapp' # options for leap_cli OPTS='--yes' -- cgit v1.2.3