2019-05-02 15:28:17 +02:00
|
|
|
- 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 }}"
|
2019-05-13 20:12:21 +02:00
|
|
|
esxi_hostname: '{{ esxi1 }}'
|
2019-05-02 15:28:17 +02:00
|
|
|
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']"
|
2017-11-14 16:41:55 +01:00
|
|
|
|
2019-05-02 15:28:17 +02:00
|
|
|
- name: get host facts through from a host
|
|
|
|
vmware_host_facts:
|
|
|
|
validate_certs: False
|
2019-05-13 20:12:21 +02:00
|
|
|
hostname: '{{ esxi1 }}'
|
2019-05-02 15:28:17 +02:00
|
|
|
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']"
|