ansible/test/integration/targets/vmware_host_dns/tasks/main.yml
Mario Lenz 034df49c56 VMware: New module vmware_host_dns (#64458)
* Restore module vmware_dns_config
* Remove domainname and change_hostname_to
* Changed version_added from 2.10 to '2.10'
* Add setup_attach_host: true to test case
* Add 'vcsim is not defined' block to integration tests
* Change 'result' to 'dns_config_result'
* Bugfix: Changing some static configurations while keeping others can crash the module
* Implement changing DNS config from DHCP to static on a cluster
* Update documentation for vmware_host_dns
* vmware_host_dns integration tests: Always revert to original DNS configuration, even if a test fails
* Deprecate vmware_dns_config
2019-11-16 11:25:06 +05:30

28 lines
1,016 B
YAML

# Test code for the vmware_host_dns module.
# Copyright: (c) 2019, Mario Lenz <m@riolenz.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This tests assume that all ESXi hosts either have a static or a dynamic DNS
# configuration. They probably will fail if on host is 'static' and the other
# is 'dhcp' configured.
- when: vcsim is not defined
block:
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
- name: Gather DNS facts about ESXi Host
vmware_host_dns_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: "{{ item }}"
validate_certs: False
loop: "{{ esxi_hosts }}"
register: dns
- include_tasks: dhcp.yml
when: dns['results'][0]['hosts_dns_info'][esxi1]['dhcp']
- include_tasks: static.yml
when: not dns['results'][0]['hosts_dns_info'][esxi1]['dhcp']