From ff5bd7fe06c3971427c12590dec049e69da934e7 Mon Sep 17 00:00:00 2001 From: dragon3 Date: Mon, 4 Nov 2013 23:41:44 +0900 Subject: [PATCH] Don't fail if ec2_access_key/ec2_secret_key not specified to use IAM role. --- lib/ansible/module_utils/ec2.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index eac7c5be75..45db1ccf8a 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -18,16 +18,12 @@ def get_ec2_creds(module): ec2_access_key = os.environ['EC2_ACCESS_KEY'] elif 'AWS_ACCESS_KEY' in os.environ: ec2_access_key = os.environ['AWS_ACCESS_KEY'] - else: - module.fail_json(msg="Please specify an ec2_access_key") if not ec2_secret_key: if 'EC2_SECRET_KEY' in os.environ: ec2_secret_key = os.environ['EC2_SECRET_KEY'] elif 'AWS_SECRET_KEY' in os.environ: ec2_secret_key = os.environ['AWS_SECRET_KEY'] - else: - module.fail_json(msg="Please specify an ec2_secret_key") if not region: if 'EC2_REGION' in os.environ: