1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ec2: Apply all security groups at instance-creation

The code was picking out the first instance from the security groups
specified, even when multiple groups were specified. Now we use all of
them.
This commit is contained in:
Brandon W Maister 2015-03-03 13:03:08 -05:00 committed by Matt Clay
parent 6d1fd1afcc
commit 2121bbc208

View file

@ -806,8 +806,7 @@ def create_instances(module, ec2, vpc, override_count=None):
if type(group_id) == str: if type(group_id) == str:
group_id = [group_id] group_id = [group_id]
grp_details = ec2.get_all_security_groups(group_ids=group_id) grp_details = ec2.get_all_security_groups(group_ids=group_id)
grp_item = grp_details[0] group_name = [grp_item.name for grp_item in grp_details]
group_name = [grp_item.name]
except boto.exception.NoAuthHandlerFound, e: except boto.exception.NoAuthHandlerFound, e:
module.fail_json(msg = str(e)) module.fail_json(msg = str(e))