Skip to content

Commit

Permalink
Fix prep env sanity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bhati-pradeep committed Dec 9, 2024
1 parent 2ca6e26 commit 98d4db9
Show file tree
Hide file tree
Showing 9 changed files with 677 additions and 682 deletions.
122 changes: 62 additions & 60 deletions tests/integration/targets/prepare_env/playbooks/cleanup.yml
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
Loading

0 comments on commit 98d4db9

Please sign in to comment.