From 3ba4fc2d5405fc02484c9d5ac5acf8c8cbc22947 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Tue, 27 Jun 2017 19:14:38 -0400 Subject: [PATCH] boto only returns tags in the described security group if they exist (#26053) --- lib/ansible/modules/cloud/amazon/ec2_group_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_group_facts.py b/lib/ansible/modules/cloud/amazon/ec2_group_facts.py index 026274573fc..a204a7aa82e 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_group_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_group_facts.py @@ -158,7 +158,7 @@ def main(): # Modify boto3 tags list to be ansible friendly dict # but don't camel case tags security_group = camel_dict_to_snake_dict(security_group) - security_group['tags'] = boto3_tag_list_to_ansible_dict(security_group['tags'], tag_name_key_name='key', tag_value_key_name='value') + security_group['tags'] = boto3_tag_list_to_ansible_dict(security_group.get('tags', {}), tag_name_key_name='key', tag_value_key_name='value') snaked_security_groups.append(security_group) module.exit_json(security_groups=snaked_security_groups)