Commit 8e77577d authored by Pietsch, Martin's avatar Pietsch, Martin

added reboot task from system role

parent f526e034
--- ---
- name: initialise variable that controls the reboot of the host - name: initialise variable that controls the reboot of the host
set_fact: set_fact:
doreboot: False _freebsd_reboot: False
- block: - block:
- name: get hostname of migrationhost - name: get hostname of migrationhost
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
- name: set variable that controls the reboot of the host - name: set variable that controls the reboot of the host
set_fact: set_fact:
doreboot: "{{ system_upgrade_states[migrationhost].host.state }}" _freebsd_reboot: "{{ system_upgrade_states[migrationhost].host.state }}"
when: system_upgrade_states is defined when: system_upgrade_states is defined
- block: - block:
...@@ -55,16 +55,16 @@ ...@@ -55,16 +55,16 @@
- name: set variable that controls the reboot of the host - name: set variable that controls the reboot of the host
set_fact: set_fact:
doreboot: "{{ system_upgrade_states[inventory_hostname].host.state }}" _freebsd_reboot: "{{ system_upgrade_states[inventory_hostname].host.state }}"
when: system_upgrade_states is not defined when: system_upgrade_states is not defined
- name: restart {{ inventory_hostname }} - name: debug _freebsd_reboot
command: "shutdown -r -t +10s" debug:
async: 0 var: _freebsd_reboot
poll: 0
ignore_errors: yes
when: doreboot == True
- wait_for_connection:
- include_role:
name: system
tasks_from: reboot
when: _freebsd_reboot == True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment