Debian Codegraph @

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

raw
1 # Test code for the vmware_host_ipv6 module.
2 # Copyright: (c) 2018, Christian Kotte <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4 - import_role:
5 name: prepare_vmware_tests
6 vars:
7 setup_attach_host: true
8
9 - name: Ensure IPv6 is off
10 vmware_host_ipv6:
11 hostname: "{{ vcenter_hostname }}"
12 username: "{{ vcenter_username }}"
13 password: "{{ vcenter_password }}"
14 cluster_name: "{{ ccr1 }}"
15 validate_certs: false
16 state: disabled
17 register: host_ipv6_info
18
19 - name: Enable IPv6 support for a given host
20 vmware_host_ipv6:
21 hostname: "{{ vcenter_hostname }}"
22 username: "{{ vcenter_username }}"
23 password: "{{ vcenter_password }}"
24 esxi_hostname: '{{ esxi1 }}'
25 validate_certs: false
26 state: enabled
27 register: host_ipv6_info
28 - debug: var=host_ipv6_info
29 - assert:
30 that:
31 - host_ipv6_info is defined
32 - host_ipv6_info.changed
33
34 - name: Enable IPv6 support for a given host in check mode
35 vmware_host_ipv6:
36 hostname: "{{ vcenter_hostname }}"
37 username: "{{ vcenter_username }}"
38 password: "{{ vcenter_password }}"
39 esxi_hostname: '{{ esxi1 }}'
40 validate_certs: false
41 state: enabled
42 register: host_ipv6_info_check_mode
43 check_mode: true
44 - debug: var=host_ipv6_info_check_mode
45 - assert:
46 that:
47 - host_ipv6_info_check_mode is defined
48 - not (host_ipv6_info_check_mode is changed)
49
50 - name: Reset the status again
51 vmware_host_ipv6:
52 hostname: "{{ vcenter_hostname }}"
53 username: "{{ vcenter_username }}"
54 password: "{{ vcenter_password }}"
55 cluster_name: "{{ ccr1 }}"
56 validate_certs: false
57 state: disabled
58 register: host_ipv6_info
59
60 - name: Enable IPv6 support for all hosts in given cluster
61 vmware_host_ipv6:
62 hostname: "{{ vcenter_hostname }}"
63 username: "{{ vcenter_username }}"
64 password: "{{ vcenter_password }}"
65 cluster_name: "{{ ccr1 }}"
66 validate_certs: false
67 state: enabled
68 register: hosts_ipv6_info
69 - debug: var=hosts_ipv6_info
70 - assert:
71 that:
72 - hosts_ipv6_info is defined
73 - hosts_ipv6_info.changed
74
75 - name: Enable IPv6 support for all hosts in given cluster in check mode
76 vmware_host_ipv6:
77 hostname: "{{ vcenter_hostname }}"
78 username: "{{ vcenter_username }}"
79 password: "{{ vcenter_password }}"
80 cluster_name: "{{ ccr1 }}"
81 validate_certs: false
82 state: enabled
83 register: hosts_ipv6_info_check_mode
84 check_mode: true
85 - debug: var=hosts_ipv6_info_check_mode
86 - assert:
87 that:
88 - hosts_ipv6_info_check_mode is defined
89 - not (hosts_ipv6_info_check_mode is changed)