summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md10
-rw-r--r--lib/ansible/module_utils/ec2.py28
-rw-r--r--lib/ansible/utils/module_docs_fragments/aws.py34
3 files changed, 38 insertions, 34 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 38c09d0b59..10a9ca1604 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ Ansible Changes By Release
## 2.0 "TBD" - ACTIVE DEVELOPMENT
Major Changes:
- big_ip modules now support turning off ssl certificat validation (use only for self signed)
+ big_ip modules now support turning off ssl certificate validation (use only for self signed)
New Modules:
cloudtrail
@@ -63,8 +63,8 @@ New Modules:
New Filters:
-* ternary: allows for trueval/falseval assignement dependint on conditional
-* cartesian: returns the cartesian product of 2 lists
+* ternary: allows for trueval/falseval assignment dependent on conditional
+* cartesian: returns the Cartesian product of 2 lists
* to_uuid: given a string it will return an ansible domain specific UUID
* checksum: uses the ansible internal checksum to return a hash from a string
* hash: get a hash from a string (md5, sha1, etc)
@@ -93,14 +93,14 @@ Other Notable Changes:
* restart_policy parameters to configure when the container automatically restarts
* If the docker client or server doesn't support an option, the task will now fail instead of silently ignoring the option
* Add insecure_registry parameter for connecting to registries via http
- * New parameter to set a container's domainname
+ * New parameter to set a container's domain name
* Undeprecated docker_image module until there's replacement functionality
* Allow setting the container's pid namespace
* Add a pull parameter that chooses when ansible will look for more recent images in the registry
* docker module states have been greatly enhanced. The reworked and new states are:
* present now creates but does not start containers
* restarted always restarts a container
- * reloaded restarts a container if ansible detects that the configuration is different than what is spcified
+ * reloaded restarts a container if ansible detects that the configuration is different than what is specified
* reloaded accounts for exposed ports, env vars, and volumes
* Can now connect to the docker server using TLS
* Several source control modules had force parameters that defaulted to true.
diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py
index 0f08fead18..c7bad2970b 100644
--- a/lib/ansible/module_utils/ec2.py
+++ b/lib/ansible/module_utils/ec2.py
@@ -54,7 +54,7 @@ def aws_common_argument_spec():
aws_secret_key=dict(aliases=['ec2_secret_key', 'secret_key'], no_log=True),
aws_access_key=dict(aliases=['ec2_access_key', 'access_key']),
validate_certs=dict(default=True, type='bool'),
- security_token=dict(no_log=True),
+ security_token=dict(aliases=['access_token'], no_log=True),
profile=dict(),
)
@@ -87,38 +87,38 @@ def get_aws_connection_info(module):
validate_certs = module.params.get('validate_certs')
if not ec2_url:
- if 'EC2_URL' in os.environ:
- ec2_url = os.environ['EC2_URL']
- elif 'AWS_URL' in os.environ:
+ if 'AWS_URL' in os.environ:
ec2_url = os.environ['AWS_URL']
+ elif 'EC2_URL' in os.environ:
+ ec2_url = os.environ['EC2_URL']
if not access_key:
- if 'EC2_ACCESS_KEY' in os.environ:
- access_key = os.environ['EC2_ACCESS_KEY']
- elif 'AWS_ACCESS_KEY_ID' in os.environ:
+ if 'AWS_ACCESS_KEY_ID' in os.environ:
access_key = os.environ['AWS_ACCESS_KEY_ID']
elif 'AWS_ACCESS_KEY' in os.environ:
access_key = os.environ['AWS_ACCESS_KEY']
+ elif 'EC2_ACCESS_KEY' in os.environ:
+ access_key = os.environ['EC2_ACCESS_KEY']
else:
# in case access_key came in as empty string
access_key = None
if not secret_key:
- if 'EC2_SECRET_KEY' in os.environ:
- secret_key = os.environ['EC2_SECRET_KEY']
- elif 'AWS_SECRET_ACCESS_KEY' in os.environ:
+ if 'AWS_SECRET_ACCESS_KEY' in os.environ:
secret_key = os.environ['AWS_SECRET_ACCESS_KEY']
elif 'AWS_SECRET_KEY' in os.environ:
secret_key = os.environ['AWS_SECRET_KEY']
+ elif 'EC2_SECRET_KEY' in os.environ:
+ secret_key = os.environ['EC2_SECRET_KEY']
else:
# in case secret_key came in as empty string
secret_key = None
if not region:
- if 'EC2_REGION' in os.environ:
- region = os.environ['EC2_REGION']
- elif 'AWS_REGION' in os.environ:
+ if 'AWS_REGION' in os.environ:
region = os.environ['AWS_REGION']
+ elif 'EC2_REGION' in os.environ:
+ region = os.environ['EC2_REGION']
else:
# boto.config.get returns None if config not found
region = boto.config.get('Boto', 'aws_region')
@@ -128,6 +128,8 @@ def get_aws_connection_info(module):
if not security_token:
if 'AWS_SECURITY_TOKEN' in os.environ:
security_token = os.environ['AWS_SECURITY_TOKEN']
+ elif 'EC2_SECURITY_TOKEN' in os.environ:
+ security_token = os.environ['EC2_SECURITY_TOKEN']
else:
# in case security_token came in as empty string
security_token = None
diff --git a/lib/ansible/utils/module_docs_fragments/aws.py b/lib/ansible/utils/module_docs_fragments/aws.py
index 9bbe84a135..981eb8e105 100644
--- a/lib/ansible/utils/module_docs_fragments/aws.py
+++ b/lib/ansible/utils/module_docs_fragments/aws.py
@@ -23,22 +23,29 @@ class ModuleDocFragment(object):
options:
ec2_url:
description:
- - Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used
+ - Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used.
required: false
default: null
aliases: []
aws_secret_key:
description:
- - AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
+ - AWS secret key. If not set then the value of the AWS_SECRET_ACCESS_KEY, AWS_SECRET_KEY, or EC2_SECRET_KEY environment variable is used.
required: false
default: null
aliases: [ 'ec2_secret_key', 'secret_key' ]
aws_access_key:
description:
- - AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
+ - AWS access key. If not set then the value of the AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY or EC2_ACCESS_KEY environment variable is used.
required: false
default: null
aliases: [ 'ec2_access_key', 'access_key' ]
+ security_token:
+ description:
+ - AWS STS security token. If not set then the value of the AWS_SECURITY_TOKEN or EC2_SECURITY_TOKEN environment variable is used.
+ required: false
+ default: null
+ aliases: [ 'access_token' ]
+ version_added: "1.6"
validate_certs:
description:
- When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.
@@ -54,23 +61,18 @@ options:
default: null
aliases: []
version_added: "1.6"
- security_token:
- description:
- - security token to authenticate against AWS
- required: false
- default: null
- aliases: []
- version_added: "1.6"
requirements:
- boto
notes:
- - The following environment variables can be used C(AWS_ACCESS_KEY) or
- C(EC2_ACCESS_KEY) or C(AWS_ACCESS_KEY_ID),
- C(AWS_SECRET_KEY) or C(EC2_SECRET_KEY) or C(AWS_SECRET_ACCESS_KEY),
- C(AWS_REGION) or C(EC2_REGION), C(AWS_SECURITY_TOKEN)
+ - If parameters are not set within the module, the following
+ environment variables can be used in decreasing order of precedence
+ C(AWS_URL) or C(EC2_URL),
+ C(AWS_ACCESS_KEY_ID) or C(AWS_ACCESS_KEY) or C(EC2_ACCESS_KEY),
+ C(AWS_SECRET_ACCESS_KEY) or C(AWS_SECRET_KEY) or C(EC2_SECRET_KEY),
+ C(AWS_SECURITY_TOKEN) or C(EC2_SECURITY_TOKEN),
+ C(AWS_REGION) or C(EC2_REGION)
- Ansible uses the boto configuration file (typically ~/.boto) if no
credentials are provided. See http://boto.readthedocs.org/en/latest/boto_config_tut.html
- C(AWS_REGION) or C(EC2_REGION) can be typically be used to specify the
- AWS region, when required, but
- this can also be configured in the boto config file
+ AWS region, when required, but this can also be configured in the boto config file
"""