summaryrefslogtreecommitdiffstats
path: root/replay
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2017-08-21 12:28:08 +0200
committerMatthieu Saulnier <fantom@fedoraproject.org>2017-08-21 12:28:08 +0200
commit82e085df81cd17293ff557fc3663bc5b5aad65fa (patch)
treecc0726ad1f02b81e45ba1507a143f0cb7268de6b /replay
parent7ff229eb296d4ab65ae08ea3d86c3e3dc23a5373 (diff)
downloadplaybooks-ansible-82e085df81cd17293ff557fc3663bc5b5aad65fa.tar.gz
playbooks-ansible-82e085df81cd17293ff557fc3663bc5b5aad65fa.tar.xz
playbooks-ansible-82e085df81cd17293ff557fc3663bc5b5aad65fa.zip
add limit feature in replay script and improve stdout
Diffstat (limited to 'replay')
-rwxr-xr-xreplay26
1 files changed, 22 insertions, 4 deletions
diff --git a/replay b/replay
index 85c31e6..3bc4b5d 100755
--- a/replay
+++ b/replay
@@ -15,6 +15,13 @@ FLAGS="--force-handlers -f $FORK -T $TIMEOUT"
# Stop editing, it is ready
###
+
+# sortie formatée des logs
+OK="\e[0m[ \e[92mOK\e[0m ]"
+ERROR="\e[0m[ \e[91mERROR\e[0m ]"
+INFO="\e[0m[ \e[93mINFO\e[0m ]"
+
+
REPLAY=true
COUNT=1
@@ -30,9 +37,20 @@ then
HOSTFILE=$SOURCES/hosts.tor
fi
+# need cleanup before starting loop
+rm -f $SOURCES/site.retry
+
while [[ $REPLAY == "true" ]] && [[ $COUNT -lt $COUNTLIMIT ]]
do
- if ( $CMDLINE $FLAGS -i $HOSTFILE $SOURCES/site.yml )
+ if [[ -f $SOURCES/site.retry ]]
+ then
+ LIMIT="--limit @${SOURCES}/site.retry"
+ echo -e "$OK retry file found"
+ else
+ LIMIT=""
+ echo -e "$INFO retry file not found"
+ fi
+ if ( $CMDLINE $FLAGS -i $HOSTFILE $LIMIT $SOURCES/site.yml )
then
REPLAY=false
else
@@ -43,6 +61,6 @@ done
popd >/dev/null
-echo "End of Replay"
-echo "Replay launched $COUNT times"
-echo "Have a nice day $USER !"
+echo -e "$OK End of Replay"
+echo -e "$INFO Replay launched $COUNT times"
+echo -e "$OK Have a nice day $USER !"