X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=ansible%2Fvm-update.yml;h=6c5eab04e5802780c88e98434ab482d47c31f1db;hb=d4fe54d43b23749a930247c46c3177a06c44d0ae;hp=548a49f4732d508cd3a4c92419a65536976b3998;hpb=1401f954d1d87e1a7fe82d01660fb47c64dc305b;p=noc.git diff --git a/ansible/vm-update.yml b/ansible/vm-update.yml index 548a49f..6c5eab0 100644 --- a/ansible/vm-update.yml +++ b/ansible/vm-update.yml @@ -22,9 +22,7 @@ roles: - vm/network - tasks: - - meta: flush_handlers - + post_tasks: - name: Shutdown VM async: 1 poll: 0 @@ -33,38 +31,15 @@ - name: Update VM definition hosts: _vmhost_ - vars: - run_installer: no - - tasks: + pre_tasks: - name: Wait for VM to shut down wait_for_virt: name: "{{ hostname }}" states: shutdown timeout: 30 - - - name: Undefine VM - virt: - name: "{{ hostname }}" - command: undefine - - name: Redefine VM - virt: - name: "{{ hostname }}" - command: define - xml: "{{ lookup('template', 'roles/vm/install/templates/libvirt-domain.xml.j2') }}" - - - name: Restart VM - virt: - name: "{{ hostname }}" - state: running - - - name: mark vm as autostarted - when: hostvars[hostname].install_cooked.autostart is defined - virt: - name: "{{ hostname }}" - autostart: "{{ hostvars[hostname].install_cooked.autostart }}" - command: info ## virt module needs either command or state + roles: + - vm/define - name: Apply the base vm/guest role hosts: "{{ hostname }}"