vmware/test: clean up dvswitch_0001 and dvswitch_0002

Ensure `dvswitch_0001` and `dvswitch_0002` won't remain after
`vmware_dvswitch` test execution.
This commit is contained in:
Gonéri Le Bouder 2019-08-27 10:47:38 -04:00
parent 9f8a0f4ace
commit ef69f3a3b5
2 changed files with 14 additions and 5 deletions

View file

@ -31,8 +31,12 @@
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter_name: '{{ dc1 }}'
switch_name: '{{ dvswitch1 }}'
state: absent
switch_name: '{{ item }}'
loop:
- '{{ dvswitch1 }}'
- dvswitch_0001
- dvswitch_0002
ignore_errors: yes
- name: Remove the vSwitches

View file

@ -86,10 +86,15 @@
password: "{{ vcenter_password }}"
datacenter_name: "{{ dc1 }}"
state: absent
switch_name: dvswitch_0001
register: dvs_result_0003
switch_name: '{{ item }}'
loop:
- dvswitch_0001
- dvswitch_0002
register: dvswitch_delete
- debug: var=dvswitch_delete
- name: ensure distributed vswitch is present
- name: Ensure the state has changed
assert:
that:
- dvs_result_0003.changed
- dvswitch_delete.results[0] is changed
- dvswitch_delete.results[1] is changed