diff --git a/roles/mgrote.qemu_guest_agent/handlers/main.yml b/roles/mgrote.qemu_guest_agent/handlers/main.yml new file mode 100644 index 00000000..1ac62ba0 --- /dev/null +++ b/roles/mgrote.qemu_guest_agent/handlers/main.yml @@ -0,0 +1,5 @@ +--- + - name: reboot + become: true + reboot: + reboot_timeout: 120 diff --git a/roles/mgrote.qemu_guest_agent/tasks/main.yml b/roles/mgrote.qemu_guest_agent/tasks/main.yml index 43370427..f0e68c0d 100644 --- a/roles/mgrote.qemu_guest_agent/tasks/main.yml +++ b/roles/mgrote.qemu_guest_agent/tasks/main.yml @@ -5,10 +5,4 @@ name: qemu-guest-agent state: present when: ansible_virtualization_role == 'guest' - register: qemu_installed - - - name: reboot (dauert bis zu 2min!) - become: true - reboot: - reboot_timeout: 120 - when: qemu_installed.changed == true + notify: reboot