Debian Codegraph @

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

raw
1 # Test code for the vmware_host_acceptance 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: Change acceptance level of given host in check mode
11 vmware_host_acceptance:
12 hostname: "{{ vcenter_hostname }}"
13 username: "{{ vcenter_username }}"
14 password: "{{ vcenter_password }}"
15 esxi_hostname: '{{ esxi1 }}'
16 validate_certs: false
17 state: community
18 register: host_acceptance_community_check_mode
19 check_mode: true
20 - debug: var=host_acceptance_community_check_mode
21 - assert:
22 that:
23 - host_acceptance_community_check_mode.facts is defined
24 - host_acceptance_community_check_mode.changed
25
26 - name: Change acceptance level of given host
27 vmware_host_acceptance:
28 hostname: "{{ vcenter_hostname }}"
29 username: "{{ vcenter_username }}"
30 password: "{{ vcenter_password }}"
31 esxi_hostname: '{{ esxi1 }}'
32 validate_certs: false
33 state: community
34 register: host_acceptance_community
35 - debug: var=host_acceptance_community
36 - assert:
37 that:
38 - host_acceptance_community.facts is defined
39 - host_acceptance_community.changed
40
41 - name: Change acceptance level of given host again (idempotency)
42 vmware_host_acceptance:
43 hostname: "{{ vcenter_hostname }}"
44 username: "{{ vcenter_username }}"
45 password: "{{ vcenter_password }}"
46 esxi_hostname: '{{ esxi1 }}'
47 validate_certs: false
48 state: community
49 register: host_acceptance_community_again
50 - debug: var=host_acceptance_community_again
51 - assert:
52 that:
53 - host_acceptance_community_again.facts is defined
54 - host_acceptance_community_again.changed is false