X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=ansible%2Fvm-update.yml;h=b40e06da527a3371c037c2270a3cc40084f69adc;hb=55b106ea5aeb04fcc41adee105a661fbf6e1af6c;hp=871b3c780b98c1cc6c75c197034604ec9f90aa53;hpb=e1dff95cc52cbc911eaeffd049bd8efff67528ee;p=noc.git diff --git a/ansible/vm-update.yml b/ansible/vm-update.yml index 871b3c7..b40e06d 100644 --- a/ansible/vm-update.yml +++ b/ansible/vm-update.yml @@ -18,7 +18,6 @@ - name: Update network configuration & shutdown VM hosts: "{{ hostname }}" - gather_facts: no roles: - vm/network @@ -31,35 +30,15 @@ - name: Update VM definition hosts: _vmhost_ - 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 }}"