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
set_fact:
doreboot: False
_freebsd_reboot: False
- block:
- name: get hostname of migrationhost
......@@ -33,7 +33,7 @@
- name: set variable that controls the reboot of the host
set_fact:
doreboot: "{{ system_upgrade_states[migrationhost].host.state }}"
_freebsd_reboot: "{{ system_upgrade_states[migrationhost].host.state }}"
when: system_upgrade_states is defined
- block:
......@@ -55,16 +55,16 @@
- name: set variable that controls the reboot of the host
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
- name: restart {{ inventory_hostname }}
command: "shutdown -r -t +10s"
async: 0
poll: 0
ignore_errors: yes
when: doreboot == True
- wait_for_connection:
- name: debug _freebsd_reboot
debug:
var: _freebsd_reboot
- 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