2 - name: preperations and sanity checks
3 hosts: "{{ hostname }}"
6 - name: setup variables
8 network_cooked: "{{ network }}"
9 install_cooked: "{{ install }}"
11 - name: create temporary host group for vm host
14 name: "{{ install_cooked.host }}"
15 inventory_dir: "{{inventory_dir}}"
17 # TODO: add some sanity checks
19 - name: Update network configuration & shutdown VM
20 hosts: "{{ hostname }}"
30 shell: sleep 2 && poweroff
32 - name: Update VM definition
35 - name: Wait for VM to shut down
37 name: "{{ hostname }}"
43 name: "{{ hostname }}"
48 name: "{{ hostname }}"
50 xml: "{{ lookup('template', 'roles/vm/install/templates/libvirt-domain.xml.j2') }}"
54 name: "{{ hostname }}"
57 - name: mark vm as autostarted
58 when: hostvars[hostname].install_cooked.autostart is defined
60 name: "{{ hostname }}"
61 autostart: "{{ hostvars[hostname].install_cooked.autostart }}"
62 command: info ## virt module needs either command or state
64 - name: Apply the base vm/guest role
65 hosts: "{{ hostname }}"
67 - name: Wait for the VM to be up and running