|
|
@ -486,14 +486,15 @@ def create_vpc(module, vpc_conn):
|
|
|
|
'id': sn.id,
|
|
|
|
'id': sn.id,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
# Sort subnets by the order they were listed in the play
|
|
|
|
if subnets is not None:
|
|
|
|
order = {}
|
|
|
|
# Sort subnets by the order they were listed in the play
|
|
|
|
for idx, val in enumerate(subnets):
|
|
|
|
order = {}
|
|
|
|
order[val['cidr']] = idx
|
|
|
|
for idx, val in enumerate(subnets):
|
|
|
|
|
|
|
|
order[val['cidr']] = idx
|
|
|
|
# Number of subnets in the play
|
|
|
|
|
|
|
|
subnets_in_play = len(subnets)
|
|
|
|
# Number of subnets in the play
|
|
|
|
returned_subnets.sort(key=lambda x: order.get(x['cidr'], subnets_in_play))
|
|
|
|
subnets_in_play = len(subnets)
|
|
|
|
|
|
|
|
returned_subnets.sort(key=lambda x: order.get(x['cidr'], subnets_in_play))
|
|
|
|
|
|
|
|
|
|
|
|
return (vpc_dict, created_vpc_id, returned_subnets, changed)
|
|
|
|
return (vpc_dict, created_vpc_id, returned_subnets, changed)
|
|
|
|
|
|
|
|
|
|
|
|