- - 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