Commit 6daccedc authored by Alain Takoudjou's avatar Alain Takoudjou

playbook vm-bootstrap: on reboot quickly run the playbook to configure the computer

parent 390c995f
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
- name: Add on reboot update on the VM - name: Add on reboot update on the VM
cron: name="reboot run vm bootstrap" cron: name="reboot run vm bootstrap"
special_time=reboot special_time=reboot
job="bash -lc /usr/local/bin/vm-bootstrap-update >> /var/log/vm-bootstrap.log" job="WAIT_TIME=10 bash -lc /usr/local/bin/vm-bootstrap-update >> /var/log/vm-bootstrap.log"
cron_file=ansible-vm-bootstrap user="root" cron_file=ansible-vm-bootstrap user="root"
- name: Check if /opt/slapos.playbook already exists - name: Check if /opt/slapos.playbook already exists
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
# Reruns the ansible playbook, does nothing else # Reruns the ansible playbook, does nothing else
cd /opt/slapos.playbook cd /opt/slapos.playbook
WAIT_TIME=$((1 + RANDOM % 300))
if [ -z "$WAIT_TIME" ]; then
WAIT_TIME=$((1 + RANDOM % 300));
fi
echo "Sleeping for $WAIT_TIME seconds..." echo "Sleeping for $WAIT_TIME seconds..."
sleep $WAIT_TIME sleep $WAIT_TIME
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment