+ - name: wait for installer to start
+ wait_for_virt:
+ name: "{{ hostname }}"
+ states: running
+ timeout: 10
+
+ - debug:
+ msg: "you can check on the status of the installer running this command 'virsh console {{ hostname }}' on host {{ inventory_hostname }}."
+
+ - name: wait for installer to finish or crash
+ wait_for_virt:
+ name: "{{ hostname }}"
+ states: shutdown,crashed
+ timeout: 900
+ register: installer_result
+ failed_when: installer_result.failed or installer_result.state == "crashed"
+
+ - name: undefining installer vm
+ virt:
+ name: "{{ hostname }}"
+ command: undefine
+
+ always:
+ - name: cleanup temporary workdir
+ file:
+ path: "{{ tmpdir.path }}"
+ state: absent