#!/bin/bash
# Reruns the ansible playbook, does nothing else

cd /opt/slapos.playbook

if [ -z "$WAIT_TIME" ]; then
  WAIT_TIME=$((1 + RANDOM % 300));
fi

echo "Sleeping for $WAIT_TIME seconds..."
sleep $WAIT_TIME

ansible-playbook {{ startup_playbook_id }}  -i  hosts --connection=local
