-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20d8490
commit a6cb972
Showing
18 changed files
with
285 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
- name: Destroy KVM guests | ||
hosts: localhost | ||
become: true | ||
tasks: | ||
- name: Destroy KVM guest | ||
community.libvirt.virt: | ||
state: destroyed | ||
name: "{{ guest.installer_hostname }}" | ||
loop_control: | ||
loop_var: guest | ||
label: "{{ guest.installer_hostname }}" | ||
loop: "{{ molecule_kvm_guests }}" | ||
failed_when: false | ||
|
||
- name: Undefine KVM guest | ||
community.libvirt.virt: | ||
command: undefine | ||
name: "{{ guest.installer_hostname }}" | ||
loop_control: | ||
loop_var: guest | ||
label: "{{ guest.installer_hostname }}" | ||
loop: "{{ molecule_kvm_guests }}" | ||
failed_when: false | ||
|
||
- name: Destroy KVM guest disks | ||
ansible.builtin.file: | ||
path: "{{ guest_disk }}" | ||
state: absent | ||
vars: | ||
guest_disk: "{{ molecule_libvirt_path }}/{{ guest.installer_hostname }}.img" | ||
loop_control: | ||
loop_var: guest | ||
label: "{{ guest.installer_hostname }}" | ||
loop: "{{ molecule_kvm_guests }}" | ||
|
||
|
||
- name: Destroy libvirt network and storage | ||
hosts: localhost | ||
become: true | ||
vars_files: | ||
- vars.yml | ||
tasks: | ||
- name: Stop libvirt network | ||
community.libvirt.virt_net: | ||
command: destroy | ||
name: "{{ _libvirt_network }}" | ||
when: _libvirt_network != "default" | ||
failed_when: false | ||
|
||
- name: Delete libvirt network | ||
community.libvirt.virt_net: | ||
command: undefine | ||
name: "{{ _libvirt_network }}" | ||
when: _libvirt_network != "default" | ||
|
||
- name: Undefine libvirt pool | ||
community.libvirt.virt_pool: | ||
state: undefined | ||
name: "{{ _libvirt_pool }}" | ||
|
||
- name: Destroy libvirt pool | ||
ansible.builtin.file: | ||
path: "{{ _libvirt_pool }}" | ||
state: absent |
Oops, something went wrong.