|
|
@@ -9,18 +9,36 @@ |
|
|
|
#ignore_errors: true |
|
|
|
when: reboot_command |
|
|
|
|
|
|
|
- name: let server reboot |
|
|
|
- name: wait for ssh port to be closed |
|
|
|
wait_for: |
|
|
|
host: "{{ ansible_host | default(inventory_hostname) }}" |
|
|
|
port: 22 |
|
|
|
search_regex: OpenSSH |
|
|
|
timeout: "{{ reboot_wait_for_ssh_close_timeout_seconds }}" |
|
|
|
state: absent |
|
|
|
vars: |
|
|
|
ansible_connection: local |
|
|
|
register: _reboot_wait_for_ssh_port_closed |
|
|
|
|
|
|
|
- name: note the shutdown time |
|
|
|
set_fact: |
|
|
|
_reboot_shutdown_timestamp: "{{ _current_timestamp }}" |
|
|
|
|
|
|
|
- name: pause to let host reboot |
|
|
|
pause: |
|
|
|
seconds: "{{ reboot_pause_seconds }}" |
|
|
|
register: _reboot_pause |
|
|
|
|
|
|
|
- name: wait for ssh port |
|
|
|
- name: wait for ssh port to be open again |
|
|
|
wait_for: |
|
|
|
host: "{{ ansible_host | default(inventory_hostname) }}" |
|
|
|
port: 22 |
|
|
|
search_regex: OpenSSH |
|
|
|
timeout: "{{ reboot_wait_timeout_seconds }}" |
|
|
|
timeout: "{{ reboot_wait_for_ssh_open_timeout_seconds }}" |
|
|
|
state: present |
|
|
|
vars: |
|
|
|
ansible_connection: local |
|
|
|
register: _reboot_wait_for_ssh_port_open |
|
|
|
|
|
|
|
- include_role: |
|
|
|
name: ssh_host_key |
|
|
|