VMware: Improve module vmware_host_vmnic_facts (#47278)

* fix "AttributeError: 'NoneType' object has no attribute 'nicDevice'"
* add vmnic_details output (speed, duplex, vendor, mac, etc. pp.)
* add NIC capabilities, DirectPath I/O, and SR-IOV information output
* add num_vmnics
This commit is contained in:
Christian Kotte
2018-10-30 07:51:50 +01:00
committed by Abhijeet Kasurde
parent 1ddfac5ad5
commit e0f7a522a3
2 changed files with 165 additions and 12 deletions

View File

@@ -45,7 +45,7 @@
- debug: var=host1
- name: Gather facts about all hosts in given cluster
- name: Gather vmnic facts about a host
vmware_host_vmnics_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
@@ -58,4 +58,22 @@
- assert:
that:
- host_vmnics.host_service_facts is defined
- host_vmnics.hosts_vmnics_facts is defined
- name: Gather extended vmnic facts about a host
vmware_host_vmnics_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
capabilities: true
directpath_io: true
sriov: true
register: host_vmnics_extended
- debug: var=host_vmnics_extended
- assert:
that:
- host_vmnics_extended.hosts_vmnics_facts is defined