Debian Codegraph @

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

raw
1 # Test code for the vmware_host_dns module.
2 # Copyright: (c) 2019, Mario Lenz <[email protected]>
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 # This tests assume that all ESXi hosts either have a static or a dynamic DNS
6 # configuration. They probably will fail if on host is 'static' and the other
7 # is 'dhcp' configured.
8 - import_role:
9 name: prepare_vmware_tests
10 vars:
11 setup_attach_host: true
12
13 - name: Gather DNS facts about ESXi Host
14 vmware_host_dns_info:
15 hostname: '{{ vcenter_hostname }}'
16 username: '{{ vcenter_username }}'
17 password: '{{ vcenter_password }}'
18 esxi_hostname: "{{ item }}"
19 validate_certs: false
20 loop: "{{ esxi_hosts }}"
21 register: dns
22
23 - include_tasks: dhcp.yml
24 when: dns['results'][0]['hosts_dns_info'][esxi1]['dhcp']
25 - include_tasks: static.yml
26 when: not dns['results'][0]['hosts_dns_info'][esxi1]['dhcp']