Commit graph

16 commits

Author SHA1 Message Date
Ted Timmons
b5895712b3 update documentation to include missing option
'list' was added more recently, it was omitted from the documentation.
2014-04-23 08:44:43 -05:00
willthames
509561f658 Moved AWS modules over to common module fragments
Created common module doc fragment, and applied to all
modules that use ec2_connect or connect_to_aws as
they definitely share the common doc fragments
2014-04-09 21:19:12 +10:00
James Cammarata
8ca3bb4137 Updating profile/security_token version_added labels 2014-03-11 10:48:16 -05:00
James Cammarata
430cce9df3 Merge branch 'ec2_security_token' of https://github.com/willthames/ansible into willthames-ec2_security_token 2014-03-11 10:45:38 -05:00
Will Thames
b9a7352e0a Work to allow security tokens and profiles to work with Ansible
Allow security tokens and profiles to be used as arguments
to the 'common' ec2 modules

Mostly refactoring to provide two new methods,
`get_aws_connection_info`, which results in a dict that can be
passed through to the boto `connect_to_region` calls, and
`connect_to_aws` that can pass that dict through to the
`connect_to_region` method of the appropriate module.

Tidied up some variable names

Works around boto/boto#2100

profiles don't work with boto < 2.24, but this detects for that
and fails with an appropriate message. It is designed to work
if profile is not passed but boto < 2.24 is installed.

Modifications to allow empty aws auth variables to be passed
(this is useful if wanting to have the keys as an optional
parameter in ec2 calls - if set, use this value, if not set,
use boto config or env variables)

Reworked validate_certs improvements to work with refactoring

Added documentation for profile and security_token to affected modules
2014-03-06 16:28:30 +10:00
willthames
f568140ea5 Allow ec2_tag module to list the tags of an instance
Use the list argument to state to just collect the
tags of a resource through the AWS API.
2014-03-04 23:36:17 +10:00
James Cammarata
056d54ebd3 Adding 'validate_certs' option to EC2 modules
When disabled, the boto connection will be instantiated without validating
the SSL certificate from the target endpoint. This allows the modules to connect
to Eucalyptus instances running with self-signed certs without errors.

Fixes #3978
2014-02-13 12:32:49 -06:00
Will Thames
7600c664fe Create a common EC2 connection argument spec for EC2 modules
Refactor the currently well-factored ec2 modules (i.e. those that already use ec2_connect) to
have a common argument spec. The idea is that new modules can use this spec without duplication
of code, and that new functionality can be added to the ec2 connection code (e.g. security
token argument)
2014-02-06 15:27:41 +10:00
jctanner
9a69b1b0ec Merge pull request #5311 from willthames/ec2_refactor
ec2 modules: Move more responsibility to common EC2 module
2014-01-06 14:09:38 -08:00
willthames
46a5f8c656 Make state=present the default for ec2_tag
Using `ec2_tag` module without the state argument
currently results in:
```
failed: [127.0.0.1] => {"failed": true, "parsed": false}
```
This fix makes `state=present` the default
2013-12-18 13:40:41 +10:00
willthames
12005a1cd0 Move more responsibility to common EC2 module
Moved `AWS_REGIONS` into `ec2` module
Created `ec2_connect` method in `ec2` module
Updated modules able to use `ec2_connect` and `AWS_REGIONS`
2013-12-17 14:07:24 +10:00
Brandon Hilkert
33afaebb95 Fix checking for existence of EC2 tags 2013-11-27 11:01:42 -05:00
Justin Ludwig
26374d89a0 Fix AWS credential params for s3 and other modules
The `ec2_ami`, `ec2_elb`, `ec2_tag`, `ec2_vpc`, `route53`, and `s3` modules
all canonicalize the AWS access and secret key params as
`aws_access_key` and `aws_secret_key`. However, following the fixes for #4540,
those modules now use `get_ec2_creds` from `lib/ansible/module_utils/ec2.py`,
which requires access/secret key params to be canonicalized as
`ec2_access_key` and `ec2_secret_key`. As a result, AWS credentials passed
to those six modules as parameters are ignored (they instead always use
the AWS credentials specified via environment variables, or nothing).

So this change fixes those six modules to canonicalize the
AWS access and secret key params as `ec2_access_key` and `ec2_secret_key`,
allowing them to again accept AWS credentials passed via module params.
2013-11-26 19:29:06 -08:00
James Tanner
afa5988391 Fixes #4540 Use shared module snippet to evaluate ec2 credentials 2013-11-01 11:59:24 -04:00
Harrison Gu
b5500d9a4d Fix bug for setting ec2 tags 2013-10-12 20:57:32 +08:00
lwade
eaac295fb2 Basic module to tag resources in EC2. 2013-08-13 12:55:06 -05:00