|
@@ -9,18 +9,36 @@ |
|
|
#ignore_errors: true |
|
|
#ignore_errors: true |
|
|
when: reboot_command |
|
|
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: |
|
|
pause: |
|
|
seconds: "{{ reboot_pause_seconds }}" |
|
|
seconds: "{{ reboot_pause_seconds }}" |
|
|
|
|
|
register: _reboot_pause |
|
|
|
|
|
|
|
|
- name: wait for ssh port |
|
|
|
|
|
|
|
|
- name: wait for ssh port to be open again |
|
|
wait_for: |
|
|
wait_for: |
|
|
host: "{{ ansible_host | default(inventory_hostname) }}" |
|
|
host: "{{ ansible_host | default(inventory_hostname) }}" |
|
|
port: 22 |
|
|
port: 22 |
|
|
search_regex: OpenSSH |
|
|
search_regex: OpenSSH |
|
|
timeout: "{{ reboot_wait_timeout_seconds }}" |
|
|
|
|
|
|
|
|
timeout: "{{ reboot_wait_for_ssh_open_timeout_seconds }}" |
|
|
|
|
|
state: present |
|
|
vars: |
|
|
vars: |
|
|
ansible_connection: local |
|
|
ansible_connection: local |
|
|
|
|
|
register: _reboot_wait_for_ssh_port_open |
|
|
|
|
|
|
|
|
- include_role: |
|
|
- include_role: |
|
|
name: ssh_host_key |
|
|
name: ssh_host_key |
|
|