Debian Codegraph @

ansible_collections/community/vmware/tests/integration/targets/vmware_vswitch_info/tasks/main.yml

raw
1 # Test code for the vmware_vswitch_info module.
2 # Copyright: (c) 2018, Abhijeet Kasurde <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 - import_role:
6 name: prepare_vmware_tests
7 vars:
8 setup_attach_host: true
9
10 - name: Gather vswitch info about all hosts in given cluster
11 vmware_vswitch_info:
12 hostname: "{{ vcenter_hostname }}"
13 username: "{{ vcenter_username }}"
14 password: "{{ vcenter_password }}"
15 esxi_hostname: '{{ esxi1 }}'
16 validate_certs: false
17 register: switch_info
18
19 - debug: var=switch_info
20
21 - assert:
22 that:
23 - switch_info.hosts_vswitch_info is defined
24
25 - name: Gather vswitch info about all hosts in given cluster in check mode
26 vmware_vswitch_info:
27 hostname: "{{ vcenter_hostname }}"
28 username: "{{ vcenter_username }}"
29 password: "{{ vcenter_password }}"
30 esxi_hostname: '{{ esxi1 }}'
31 validate_certs: false
32 register: switch_info_check_mode
33 check_mode: true
34
35 - debug: var=switch_info_check_mode
36
37 - assert:
38 that:
39 - switch_info_check_mode.hosts_vswitch_info is defined
40
41 - name: Gather vswitch policies info about all hosts in given cluster
42 vmware_vswitch_info:
43 hostname: "{{ vcenter_hostname }}"
44 username: "{{ vcenter_username }}"
45 password: "{{ vcenter_password }}"
46 esxi_hostname: '{{ esxi1 }}'
47 validate_certs: false
48 policies: true
49 register: switch_policies_info
50
51 - debug: var=switch_policies_info
52
53 - assert:
54 that:
55 - switch_policies_info.hosts_vswitch_info is defined
56 - switch_policies_info.hosts_vswitch_info[esxi1] is defined
57 - switch_policies_info.hosts_vswitch_info[esxi1]['vSwitch0'] is defined
58 - switch_policies_info.hosts_vswitch_info[esxi1]['vSwitch0'].security is defined
59 - switch_policies_info.hosts_vswitch_info[esxi1]['vSwitch0'].ts is defined
60 - switch_policies_info.hosts_vswitch_info[esxi1]['vSwitch0'].lb is defined