|
@@ -9,24 +9,30 @@ |
|
|
reboot_state == "rebooted" or |
|
|
reboot_state == "rebooted" or |
|
|
reboot_state == "started" |
|
|
reboot_state == "started" |
|
|
|
|
|
|
|
|
|
|
|
- name: let server reboot |
|
|
|
|
|
pause: |
|
|
|
|
|
seconds: "{{ reboot_delay }}" |
|
|
|
|
|
when: |
|
|
|
|
|
reboot_state == "rebooted" or |
|
|
|
|
|
reboot_state == "reachable" |
|
|
|
|
|
|
|
|
- name: wait for ssh |
|
|
- name: wait for ssh |
|
|
local_action: wait_for host={{ ansible_host | default(inventory_hostname) }} port=22 search_regex=OpenSSH delay={{ reboot_delay }} timeout={{ reboot_timeout }} state=started |
|
|
|
|
|
|
|
|
local_action: wait_for host={{ ansible_host | default(inventory_hostname) }} port=22 search_regex=OpenSSH delay=0 timeout={{ reboot_timeout }} state=started |
|
|
when: |
|
|
when: |
|
|
reboot_state == "rebooted" or |
|
|
reboot_state == "rebooted" or |
|
|
|
|
|
reboot_state == "reachable" or |
|
|
reboot_state == "finished" |
|
|
reboot_state == "finished" |
|
|
|
|
|
|
|
|
- name: try to connect to ssh |
|
|
- name: try to connect to ssh |
|
|
setup: |
|
|
setup: |
|
|
retries: 6 |
|
|
|
|
|
delay: 5 |
|
|
|
|
|
when: |
|
|
when: |
|
|
reboot_state == "rebooted" or |
|
|
reboot_state == "rebooted" or |
|
|
reboot_state == "finished" |
|
|
reboot_state == "finished" |
|
|
|
|
|
|
|
|
- name: check uptime fpr sucsessfull reboot |
|
|
|
|
|
|
|
|
- name: check uptime for sucsessfull reboot |
|
|
fail: |
|
|
fail: |
|
|
msg: host did not reboot; uptime is {{ansible_uptime_seconds}} seconds |
|
|
msg: host did not reboot; uptime is {{ansible_uptime_seconds}} seconds |
|
|
when: |
|
|
when: |
|
|
- ansible_uptime_seconds > reboot_delay + reboot_timeout |
|
|
|
|
|
- reboot_state == "rebooted" or |
|
|
- reboot_state == "rebooted" or |
|
|
reboot_state == "finished" |
|
|
reboot_state == "finished" |
|
|
|
|
|
- ansible_uptime_seconds > reboot_delay + reboot_timeout |