From an old-style fact module back to a new one, this module can be used to gather information on the physical network interfaces on your VMware ESXi hosts:
- name: Find out facts about the vmnics on all the ESXi hosts
vmware_host_vmnic_facts:
hostname: "{{ vsphere_host }}"
username: "{{ vsphere_username }}"
password: "{{ vsphere_password }}"
validate_certs: "no"
datacenter: "my_datacenter"
register: cluster_vmnics
For a single ESXi host, we could use the following task:
- name: Find out facts about the vmnics on a single ESXi host
vmware_host_vmnic_facts:
hostname: "{{ vsphere_host }}"
username: "{{ vsphere_username }}"
password: "{{ vsphere_password }}"
validate_certs: "no"
esxi_hostname: "{{ exsi_host }}"
register: host_vmnics