From bfb36f0f1fa3385f2b53e846465bf8c2fedaef23 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 13 May 2015 17:11:28 -0400 Subject: [PATCH] Tell me what the igw id is if we created an igw. --- lib/ansible/modules/cloud/amazon/ec2_vpc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc.py b/lib/ansible/modules/cloud/amazon/ec2_vpc.py index 0f3bb3e4fcb..9e1b5d6a47b 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc.py @@ -182,6 +182,17 @@ def get_vpc_info(vpc): 'state': vpc.state, }) +def get_igw_info(igw): + """ + Get info about the internet gateway. + """ + if igw is None: + return {} + + return ({ + 'id': igw.id, + }) + def find_vpc(module, vpc_conn, vpc_id=None, cidr=None): """ Finds a VPC that matches a specific id or cidr + tags