-
Notifications
You must be signed in to change notification settings - Fork 42
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
2ca6e26
commit 98d4db9
Showing
9 changed files
with
677 additions
and
682 deletions.
There are no files selected for viewing
122 changes: 62 additions & 60 deletions
122
tests/integration/targets/prepare_env/playbooks/cleanup.yml
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 |
---|---|---|
@@ -1,65 +1,67 @@ | ||
--- | ||
- name: clean up the environment | ||
- name: Clean up the environment | ||
hosts: localhost | ||
gather_facts: false | ||
collections: | ||
- nutanix.ncp | ||
tasks: | ||
- name: Include var file | ||
ansible.builtin.include_vars: ../vars/main.yml | ||
- name: Delete VM | ||
ignore_errors: true | ||
register: result | ||
nutanix.ncp.ntnx_vms: | ||
vm_uuid: "{{ vm.uuid }}" | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
# # - name: Delete DR VM | ||
# # ntnx_vms: | ||
# # vm_uuid: '{{dr_vm.uuid }}' | ||
# # state: absent | ||
# # nutanix_host: "{{ ip }}" | ||
# # nutanix_username: "{{ username }}" | ||
# # nutanix_password: "{{ password }}" | ||
# # validate_certs: False | ||
- name: Delete overlay | ||
register: result | ||
ignore_errors: true | ||
nutanix.ncp.ntnx_subnets: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
subnet_uuid: "{{ item }}" | ||
loop: | ||
- "{{ overlay.uuid }}" | ||
- name: Delete vpc | ||
register: result | ||
ignore_errors: true | ||
nutanix.ncp.ntnx_vpcs: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
vpc_uuid: "{{ vpc.uuid }}" | ||
- name: Delete subnets | ||
ignore_errors: true | ||
register: result | ||
nutanix.ncp.ntnx_subnets: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
subnet_uuid: "{{ item }}" | ||
loop: | ||
- "{{ external_nat_subnet.uuid }}" | ||
- "{{ static.uuid }}" | ||
|
||
- name: include var file | ||
include_vars: ../vars/main.yml | ||
- name: Delete VM | ||
ignore_errors: true | ||
ntnx_vms: | ||
vm_uuid: '{{vm.uuid }}' | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: False | ||
# # - name: Delete DR VM | ||
# # ntnx_vms: | ||
# # vm_uuid: '{{dr_vm.uuid }}' | ||
# # state: absent | ||
# # nutanix_host: "{{ ip }}" | ||
# # nutanix_username: "{{ username }}" | ||
# # nutanix_password: "{{ password }}" | ||
# # validate_certs: False | ||
- name: Delete overlay | ||
ignore_errors: true | ||
ntnx_subnets: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
subnet_uuid: "{{item }}" | ||
loop: | ||
- "{{overlay.uuid}}" | ||
- name: Delete vpc | ||
ignore_errors: true | ||
ntnx_vpcs: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: False | ||
vpc_uuid: "{{ vpc.uuid }}" | ||
- name: Delete subnets | ||
ignore_errors: true | ||
ntnx_subnets: | ||
state: absent | ||
nutanix_host: "{{ ip }}" | ||
nutanix_username: "{{ username }}" | ||
nutanix_password: "{{ password }}" | ||
validate_certs: false | ||
subnet_uuid: "{{item }}" | ||
loop: | ||
- "{{external_nat_subnet.uuid}}" | ||
- "{{static.uuid}}" | ||
|
||
- name: Delete downloaded disk file | ||
ignore_errors: true | ||
file: | ||
path: "{{ disk_image.dest }}" | ||
state: absent | ||
- name: Delete downloaded disk file | ||
ignore_errors: true | ||
register: result | ||
ansible.builtin.file: | ||
path: "{{ disk_image.dest }}" | ||
state: absent |
Oops, something went wrong.