diff --git a/tests/functional/reboot.yml b/tests/functional/reboot.yml new file mode 100644 index 000000000..dbefdef4c --- /dev/null +++ b/tests/functional/reboot.yml @@ -0,0 +1,16 @@ +--- +- hosts: all + gather_facts: true + tasks: + # why sleep 2? see here: https://github.com/ansible/ansible/issues/14413 + - name: reboot the machines + shell: sleep 2 && shutdown -r now + become: yes + async: 1 + poll: 0 + + - name: waiting 3 minutes for the machines to come back + local_action: wait_for host={{ ansible_default_ipv4.address }} port=22 state=started delay=30 timeout=180 + + - name: uptime + command: uptime diff --git a/tox.ini b/tox.ini index 94a6ca5dc..e2bd044dd 100644 --- a/tox.ini +++ b/tox.ini @@ -224,7 +224,7 @@ commands= testinfra -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests # reboot all vms - vagrant reload --no-provision + ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/reboot.yml # wait 2 minutes for services to be ready sleep 120