Skip to content

Commit

Permalink
move delete to after assert
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemorency committed Dec 19, 2024
1 parent 91358b9 commit a023499
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions tests/integration/targets/vmware_content_template/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@
host: "{{ template_host }}"
register: __res

- name: Delete template from content library
vmware.vmware.content_template:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
port: "{{ vcenter_port }}"
template: "{{ template_name }}"
library: "{{ library }}"
vm_name: "{{ vm }}"
host: "{{ template_host }}"
state: absent
register: __res

- name: Assert values
ansible.builtin.assert:
that:
Expand All @@ -74,6 +60,19 @@
- __res.template_info.msg == "Template '" + template_name + "'."
when: not run_on_simulator

- name: Delete template from content library
vmware.vmware.content_template:
validate_certs: false
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
port: "{{ vcenter_port }}"
template: "{{ template_name }}"
library: "{{ library }}"
vm_name: "{{ vm }}"
host: "{{ template_host }}"
state: absent

always:
- name: "Test teardown: Destroy VM guest {{ vm }}"
community.vmware.vmware_guest:
Expand Down

0 comments on commit a023499

Please sign in to comment.