You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- ---
-
- - name: reboot
- command: shutdown --no-wall -r +1
- async: 0
- poll: 0
- ignore_errors: true
- when:
- reboot_state == "rebooted" or
- reboot_state == "started"
-
- - name: let server reboot
- pause:
- seconds: "{{ reboot_delay }}"
- when:
- reboot_state == "rebooted" or
- reboot_state == "reachable"
-
- - name: wait for ssh
- local_action: wait_for host={{ ansible_host | default(inventory_hostname) }} port=22 search_regex=OpenSSH delay=0 timeout={{ reboot_timeout }} state=started
- when:
- reboot_state == "rebooted" or
- reboot_state == "reachable" or
- reboot_state == "finished"
-
- - name: try to connect to ssh
- setup:
- when:
- reboot_state == "rebooted" or
- reboot_state == "finished"
-
- - name: check uptime for sucsessfull reboot
- fail:
- msg: host did not reboot; uptime is {{ansible_uptime_seconds}} seconds
- when:
- - reboot_state == "rebooted" or
- reboot_state == "finished"
- - ansible_uptime_seconds > reboot_delay + reboot_timeout
|