diff options
author | Matthieu Saulnier <fantom@fedoraproject.org> | 2017-08-21 12:28:08 +0200 |
---|---|---|
committer | Matthieu Saulnier <fantom@fedoraproject.org> | 2017-08-21 12:28:08 +0200 |
commit | 82e085df81cd17293ff557fc3663bc5b5aad65fa (patch) | |
tree | cc0726ad1f02b81e45ba1507a143f0cb7268de6b /replay | |
parent | 7ff229eb296d4ab65ae08ea3d86c3e3dc23a5373 (diff) | |
download | playbooks-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-x | replay | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -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 !" |