blob: 7c03b30342e66b22263f74013c2865a5cd059e5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
- hosts: all
become: true
gather_facts: false
tasks:
- ansible.builtin.include_role:
name: zfs
tasks_from: dataset-check-duplicate.yml
apply:
delegate_to: "{{ hypervisor_host }}"
- ansible.builtin.include_role:
name: libvirt
tasks_from: vm-check-duplicate.yml
apply:
delegate_to: "{{ hypervisor_host }}"
- ansible.builtin.include_role:
name: zfs
tasks_from: dataset-create.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.debug:
msg: VM install failed, removing dataset
- 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 }}"
|