From 7b7f79171a872c8f078c916b7232e9a437d56860 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 26 Mar 2019 14:57:54 -0400 Subject: [PATCH] tests/functional: Use the ansible reboot module Ansible 2.7 introduces the reboot module so we don't need to use the shell/reboot + wait_for tasks. https://docs.ansible.com/ansible/latest/modules/reboot_module.html Signed-off-by: Dimitri Savineau --- tests/functional/reboot.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/functional/reboot.yml b/tests/functional/reboot.yml index 50b6dc8ca..e79cc1359 100644 --- a/tests/functional/reboot.yml +++ b/tests/functional/reboot.yml @@ -2,21 +2,8 @@ - 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 + reboot: + reboot_timeout: 180 + test_command: uptime become: yes - async: 1 - poll: 0 - - - name: waiting 3 minutes for the machines to come back - local_action: - module: wait_for - host: "{{ ansible_default_ipv4.address }}" - port: 22 - state: started - delay: 30 - timeout: 180 - - - name: uptime - command: uptime -- 2.39.5