From 81a1579e2027fb92a7a14bcbc19bd43bc35bbc25 Mon Sep 17 00:00:00 2001 From: Guto Andreollo Date: Mon, 20 Jul 2015 18:39:31 -0300 Subject: [PATCH] Added the 'hw_interfaces' array, listing the names of all interfaces present on the VM as 'ansible_interfaces' lists the ones seen by the operating system --- lib/ansible/modules/cloud/vmware/vsphere_guest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/vmware/vsphere_guest.py b/lib/ansible/modules/cloud/vmware/vsphere_guest.py index 8629d32df4c..a2f5f2cc1a8 100644 --- a/lib/ansible/modules/cloud/vmware/vsphere_guest.py +++ b/lib/ansible/modules/cloud/vmware/vsphere_guest.py @@ -1165,6 +1165,7 @@ def gather_facts(vm): 'hw_product_uuid': vm.properties.config.uuid, 'hw_processor_count': vm.properties.config.hardware.numCPU, 'hw_memtotal_mb': vm.properties.config.hardware.memoryMB, + 'hw_interfaces':[], } netInfo = vm.get_property('net') netDict = {} @@ -1187,6 +1188,7 @@ def gather_facts(vm): 'macaddress_dash': entry.macAddress.replace(':', '-'), 'summary': entry.deviceInfo.summary, } + facts['hw_interfaces'].append('eth'+str(ifidx)) ifidx += 1