mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
4b99a2ac50
The use of the `hostvars[esxi1].ansible_host` was attempt to use different hostname and IP address. But it's actually the source of more problems. VMware expects to be able to resolvable the host name. This means, that if someone wants to run the test-suite, s/he needs to use a DNS or update the `/etc/hosts` files on the different hosts.
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
- when: vcsim is not defined
|
|
block:
|
|
- import_role:
|
|
name: prepare_vmware_tests
|
|
vars:
|
|
setup_attach_host: true
|
|
- name: get host facts through a vcenter
|
|
vmware_host_facts:
|
|
validate_certs: False
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
esxi_hostname: '{{ esxi1 }}'
|
|
register: facts
|
|
- debug: var=facts
|
|
- name: verify some data,like ansible_processor
|
|
assert:
|
|
that:
|
|
- "'ansible_hostname' in facts['ansible_facts']"
|
|
- "'ansible_processor' in facts['ansible_facts']"
|
|
|
|
- name: get host facts through from a host
|
|
vmware_host_facts:
|
|
validate_certs: False
|
|
hostname: '{{ esxi1 }}'
|
|
username: '{{ hostvars[esxi1].ansible_user }}'
|
|
password: '{{ hostvars[esxi1].ansible_password }}'
|
|
register: facts
|
|
- debug: var=facts
|
|
- name: verify some data,like ansible_processor
|
|
assert:
|
|
that:
|
|
- "'ansible_hostname' in facts['ansible_facts']"
|
|
- "'ansible_processor' in facts['ansible_facts']"
|