summaryrefslogtreecommitdiffstats
path: root/replay
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2017-06-22 05:57:21 +0200
committerMatthieu Saulnier <fantom@fedoraproject.org>2017-06-22 05:57:21 +0200
commit9dcfc0eb3769e21d8661ca700b3627e9b77463cb (patch)
tree435e888484fb9925b32d2e7e1634650ee8ebcd22 /replay
parentcebbfeed8ef195941a42884993fb7075d427c316 (diff)
downloadplaybooks-ansible-9dcfc0eb3769e21d8661ca700b3627e9b77463cb.tar.gz
playbooks-ansible-9dcfc0eb3769e21d8661ca700b3627e9b77463cb.tar.xz
playbooks-ansible-9dcfc0eb3769e21d8661ca700b3627e9b77463cb.zip
fix torrc template and remove vim pkg on all hosts and add clearnet feature in replay script
Diffstat (limited to 'replay')
-rwxr-xr-xreplay24
1 files changed, 19 insertions, 5 deletions
diff --git a/replay b/replay
index 90b1ef3..85c31e6 100755
--- a/replay
+++ b/replay
@@ -6,6 +6,11 @@
SOURCES=$HOME/park-admin/playbooks-ansible
WORKDIR=/tmp
COUNTLIMIT=10
+# Availables options are: 'clearnet' or 'tornetwork'
+NETWORK=clearnet
+FORK=8
+TIMEOUT=240
+FLAGS="--force-handlers -f $FORK -T $TIMEOUT"
###
# Stop editing, it is ready
###
@@ -13,22 +18,31 @@ COUNTLIMIT=10
REPLAY=true
COUNT=1
-pushd $WORKDIR
+pushd $WORKDIR >/dev/null
+
+if [[ $NETWORK == "clearnet" ]]
+then
+ CMDLINE=ansible-playbook
+ HOSTFILE=$SOURCES/hosts.net
+elif [[ $NETWORK == "tornetwork" ]]
+then
+ CMDLINE="torsocks ansible-playbook"
+ HOSTFILE=$SOURCES/hosts.tor
+fi
while [[ $REPLAY == "true" ]] && [[ $COUNT -lt $COUNTLIMIT ]]
do
- if ( torsocks ansible-playbook --force-handlers -i $SOURCES/hosts $SOURCES/site.yml )
+ if ( $CMDLINE $FLAGS -i $HOSTFILE $SOURCES/site.yml )
then
REPLAY=false
else
- REPLAY=true
# no infinite loop
COUNT=$((COUNT + 1))
fi
done
-popd
+popd >/dev/null
echo "End of Replay"
echo "Replay launched $COUNT times"
-echo "Have a nice day!"
+echo "Have a nice day $USER !"