From c3777a6e54eca269b6b38da84fdc956d6117a945 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 25 Feb 2019 22:43:25 +0530 Subject: [PATCH] VMware: add missing fact about IP network in firewall facts (#52554) Fixes: #52526 Signed-off-by: Abhijeet Kasurde --- .../modules/cloud/vmware/vmware_host_firewall_facts.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_firewall_facts.py b/lib/ansible/modules/cloud/vmware/vmware_host_firewall_facts.py index 9f4dcb3c9d..e9b053e811 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_firewall_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_firewall_facts.py @@ -67,7 +67,13 @@ hosts_firewall_facts: { "allowed_hosts": { "all_ip": true, - "ip_address": [] + "ip_address": [ + "10.10.10.1", + ], + "ip_network": [ + "11.111.112.0/22", + "192.168.10.1/24" + ], }, "enabled": true, "key": "CIMHttpServer", @@ -117,6 +123,7 @@ class FirewallFactsManager(PyVmomi): allowed_host = rule_obj.allowedHosts rule_allow_host = dict() rule_allow_host['ip_address'] = [ip for ip in allowed_host.ipAddress] + rule_allow_host['ip_network'] = [ip.network + "/" + str(ip.prefixLength) for ip in allowed_host.ipNetwork] rule_allow_host['all_ip'] = allowed_host.allIp rule_dict['allowed_hosts'] = rule_allow_host return rule_dict