aboutsummaryrefslogtreecommitdiff
path: root/vm-create.yml
diff options
context:
space:
mode:
Diffstat (limited to 'vm-create.yml')
-rw-r--r--vm-create.yml25
1 files changed, 20 insertions, 5 deletions
diff --git a/vm-create.yml b/vm-create.yml
index cfe9f8d..115be1d 100644
--- a/vm-create.yml
+++ b/vm-create.yml
@@ -21,8 +21,23 @@
apply:
delegate_to: "{{ hypervisor_host }}"
- - ansible.builtin.include_role:
- name: libvirt
- tasks_from: vm-install.yml
- apply:
- delegate_to: "{{ hypervisor_host }}"
+ - block:
+ - ansible.builtin.include_role:
+ name: libvirt
+ tasks_from: vm-install.yml
+ apply:
+ delegate_to: "{{ hypervisor_host }}"
+
+ rescue:
+ - ansible.builtin.include_role:
+ name: zfs
+ tasks_from: dataset-confirm-info.yml
+ apply:
+ delegate_to: "{{ hypervisor_host }}"
+
+ - ansible.builtin.include_role:
+ name: zfs
+ tasks_from: dataset-destroy.yml
+ apply:
+ delegate_to: "{{ hypervisor_host }}"
+