From 2916a8bf5d3d8e2724e806c291b020c267a8d04f Mon Sep 17 00:00:00 2001 From: Rob Date: Sat, 12 Dec 2015 11:33:10 +0000 Subject: [PATCH] Add secondary addresses to facts --- lib/ansible/modules/extras/cloud/amazon/ec2_eni_facts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/extras/cloud/amazon/ec2_eni_facts.py b/lib/ansible/modules/extras/cloud/amazon/ec2_eni_facts.py index b96f641624c..86d2217e3a2 100644 --- a/lib/ansible/modules/extras/cloud/amazon/ec2_eni_facts.py +++ b/lib/ansible/modules/extras/cloud/amazon/ec2_eni_facts.py @@ -63,6 +63,11 @@ def get_error_message(xml_string): def get_eni_info(interface): + # Private addresses + private_addresses = [] + for ip in interface.private_ip_addresses: + private_addresses.append({ 'private_ip_address': ip.private_ip_address, 'primary_address': ip.primary }) + interface_info = {'id': interface.id, 'subnet_id': interface.subnet_id, 'vpc_id': interface.vpc_id, @@ -73,6 +78,7 @@ def get_eni_info(interface): 'private_ip_address': interface.private_ip_address, 'source_dest_check': interface.source_dest_check, 'groups': dict((group.id, group.name) for group in interface.groups), + 'private_ip_addresses': private_addresses } if interface.attachment is not None: