From bed5f7317d9ee42ebbaff4f9fad0f02fdb4f0d53 Mon Sep 17 00:00:00 2001 From: Vinay Dandekar Date: Fri, 13 Apr 2018 08:46:26 -0400 Subject: [PATCH] Remove boolean check for underscore in IAM role (#38664) Underscore is a valid character in an IAM role, per the docs https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html --- lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py b/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py index 959de2c5c00..4594058d9d8 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py @@ -458,7 +458,7 @@ class Ec2Metadata(object): new_fields = {} for key, value in fields.items(): split_fields = key[len(uri):].split('/') - if len(split_fields) == 3 and split_fields[0:2] == ['iam', 'security-credentials'] and '_' not in split_fields[2]: + if len(split_fields) == 3 and split_fields[0:2] == ['iam', 'security-credentials']: new_fields[self._prefix % "iam-instance-profile-role"] = split_fields[2] if len(split_fields) > 1 and split_fields[1]: new_key = "-".join(split_fields)