]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests/functional: Use the ansible reboot module
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 26 Mar 2019 18:57:54 +0000 (14:57 -0400)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Wed, 27 Mar 2019 08:30:50 +0000 (08:30 +0000)
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 <dsavinea@redhat.com>
tests/functional/reboot.yml

index 50b6dc8cac9b896ac80af80286714c85138b45c9..e79cc1359b898672c7e9f3a5699f2a2952bf9163 100644 (file)
@@ -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