From 3143abc8dc0006e1c15191df2ba4b033e163e366 Mon Sep 17 00:00:00 2001 From: kcd83 Date: Sat, 24 Nov 2018 13:51:50 +1300 Subject: [PATCH] ec2_metadata_facts: Handle missing identity_document_region (#49040) * Handle missing identity_document_region * Fix indentation size to match standard --- lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py | 3 ++- 1 file changed, 2 insertions(+), 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 e0ebc68802..3d8b178648 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_metadata_facts.py @@ -532,7 +532,8 @@ class Ec2Metadata(object): data = self.fix_invalid_varnames(data) # Maintain old key for backwards compatibility - data['ansible_ec2_placement_region'] = data['ansible_ec2_instance_identity_document_region'] + if 'ansible_ec2_instance_identity_document_region' in data: + data['ansible_ec2_placement_region'] = data['ansible_ec2_instance_identity_document_region'] return data