Commit graph

82 commits

Author SHA1 Message Date
Yap Sok Ann
d2329baa93 ec2: Fix bug with running/stopped state and wait=yes.
If `get_all_instances` returns multiple reservations, the old wait loop only
dealt with the first reservation. Thus, the wait loop may end before all
instances get to be running/stopped.

Also clean up the code a little.
2014-05-09 11:35:48 +08:00
Ian Pointer
5a5e16776f Adding type int for count (in line with other cloud modules) 2014-03-23 13:51:54 -04:00
jjshoe
2a80987436 assign_public_ip was actually added in 1.5
Checked 1.4.5 and this option doesn't exist. Will check/update/pull docs next.
2014-03-20 09:21:10 -05:00
joehack3r
e4842b5df2 Update example to include delete on termination 2014-03-18 15:49:27 -05:00
James Cammarata
d319e8be30 Merge branch 'josephtate-devel' into devel 2014-03-11 11:00:40 -05:00
James Cammarata
0ddc094b8f Merge branch 'drcapulet/ec2-sourcedestcheck' of https://github.com/drcapulet/ansible into drcapulet-drcapulet/ec2-sourcedestcheck 2014-03-11 10:56:44 -05:00
James Cammarata
789a2915d1 Updating profile/security_token version_added labels 2014-03-11 10:48:16 -05:00
James Cammarata
d0495f5528 Merge branch 'ec2_security_token' of https://github.com/willthames/ansible into willthames-ec2_security_token 2014-03-11 10:45:38 -05:00
willthames
10019c13b6 Make it easier to determine whether instance creation or tagging fails 2014-03-06 16:30:39 +10:00
Will Thames
7d0e161662 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
Michael DeHaan
1f0991c88c Since the ec2 parameter is named 'key_name' and 'keypair' is just an alias, use
the primary name of the parameter in the examples.
2014-02-28 13:52:47 -05:00
James Cammarata
94506632d8 Merge pull request #5689 from pgehres/devel
Adding the region to the output of the ec2 module's creation of a new in...
2014-02-26 14:45:12 -06:00
James Cammarata
2f31dadf33 Merge branch 'devel' of https://github.com/josephtate/ansible into josephtate-devel
Conflicts:
	library/cloud/ec2
2014-02-26 13:57:07 -06:00
James Cammarata
6e47729d5a Merge branch 'ec2-params' of https://github.com/scottanderson42/ansible into scottanderson42-ec2-params
Conflicts:
	lib/ansible/module_utils/ec2.py
	library/cloud/ec2
2014-02-26 09:37:26 -06:00
James Laska
306255d808 Resolves issue#6067 by allowing exact_count=0 2014-02-19 16:29:15 -05:00
Peter Gehres
85d40f0837 Adding the region to the output of the ec2 module's creation of a new instance. 2014-02-13 22:40:49 -08:00
James Cammarata
24759f566c 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
cc35e80a54 ec2 module fails when state is not absent
tagged_instances is initialised in a scope not visible
when state is not absent.
2014-02-13 19:51:33 +10:00
Michael DeHaan
7cf513d4ed Merge pull request #5883 from amirhhz/improve-ec2-module-docs
Improve ec2 module docs
2014-02-09 14:07:35 -05:00
Scott Anderson
26e9c1ad61 Change standard AWS access and secret key parameter names to aws_access_key and aws_secret_key. Fixes an authentication problem with the rds module and standardizes the naming convention on something more encompassing than ec2_*_key. 2014-02-08 18:35:26 -05:00
James Tanner
7268d06bfe Make ec2 exact_count and count mutually exclusive 2014-02-07 13:42:43 -05:00
James Tanner
e45b0c7dce Return a tagged_instances list for hosts that matched the count_tag 2014-02-07 13:07:34 -05:00
James Tanner
0f1d695628 Make an example that sets the instance Names 2014-02-07 10:49:13 -05:00
James Tanner
f5539f8545 Update docstrings 2014-02-07 10:34:45 -05:00
James Tanner
c19936fba1 Add exact_count and count_tag to the ec2 module. 2014-02-06 23:25:57 -05:00
Will Thames
f92e4605ab 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
Amir H. Hajizamani
100e0e2734 Neaten up example YAML with 2-space indenting 2014-02-05 15:14:44 +00:00
Amir H. Hajizamani
d31d553571 Example should put instance_ids list in quotes for avoid YAML error 2014-02-05 15:12:41 +00:00
Timur Batyrshin
9ad52632c5 reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852) 2014-02-03 13:00:40 -06:00
James Tanner
eb71120435 Fix start/stop example in ec2 2014-01-27 17:48:42 -05:00
James Tanner
eb4c01caf6 Merge branch 'feat/ec2_start_stop' of git://github.com/Geryon/ansible into Geryon-feat/ec2_start_stop 2014-01-27 17:39:24 -05:00
willthames
205dddfd4c Added the ability to add volumes to instances at creation time
This allows a volume to be cloned from a snapshot, a brand new
volume to be created, or an ephemeral volumes to be associated
at time of instance creation.

This avoids any race conditions associated with creating extra volumes
after instance creation (e.g. writes happening before the volume is
mounted).

In addition, this allows the root volume to be edited
2014-01-25 12:38:41 +10:00
willthames
b884451cb7 keypair is not absolutely required when creating ec2 instances 2014-01-14 09:12:01 +10:00
Joseph Tate
eb1288b961 Add capability check for parameters on request_spot_instances 2013-12-19 18:16:56 -05:00
willthames
74f9f91abf 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
Alex Coomans
a70d636f03 Add ability to disable the Source/Destination check on EC2 2013-12-13 18:06:03 -06:00
Joseph Tate
c89c645b27 Added version_added for spot instance parameters 2013-12-13 15:01:58 -05:00
Joseph Tate
4ae79b1cb7 Extend ec2 module to support spot instances 2013-12-13 13:43:30 -05:00
Nicholas DeClario
8b5fee61bb Added ability to start and stop existing EC2 instances. 2013-12-12 17:16:59 -05:00
James Tanner
576cd98d62 Merge pull request #4502 from dxsarmit/ansible
New library/cloud/ec2 module parameter (assign_public_ip) for non-default VPC instance launching.
2013-12-02 09:43:20 -05:00
Rob Szewczyk
53e9a422e8 Correcting the security group id lookup from the list of security group names 2013-11-08 17:46:41 -05:00
James Laska
582a32040b Honor wait on ec2 instance termination 2013-11-01 18:57:20 -04:00
James Tanner
0a5adda059 Fixes #4540 Use shared module snippet to evaluate ec2 credentials 2013-11-01 11:59:24 -04:00
Michael DeHaan
b5e5a96d03 Leverage 4318b27 and no longer treat instance tags as JSON, but as dictionary types which could be key=value or dicts or JSON or references. 2013-10-31 18:46:13 -04:00
Scott Armit
957ef6efb3 If an AWS account does not have a default subnet in their VPC configuration, then creating instances in that VPC will not automatically provide a public IP/DNS. Boto added this functionality in 2.13.0 (NetworkInterfaceSpecification.associate_public_ip_address).
This change adds assign_pubic_ip as a parameter to the ec2 module, ensuring that it is not set to one of BOOLEANS_TRUE if vpc_subnet_id is not also set, and if Boto is less than 2.13.0.
2013-10-28 10:11:38 -04:00
James Tanner
740491e0ce Fixes #4500 change ec2 module params to type=bool
Revert 4833c2fdf0
2013-10-24 09:19:25 -04:00
Andy Kluger
1cc0a8af6d Corrected docs ("monitor" -> "monitoring" and dissociated monitoring from instance_tags in examples) 2013-10-11 13:32:23 -04:00
Michael DeHaan
b73f311f8b Make group_id be a list. 2013-10-07 15:34:35 -04:00
James Cammarata
e14d857037 Make the ec2 wait code a little smarter
The code to determine the number of running instances could blow up
if the response from AWS did not actually contain any data. This code
makes it a bit smarter in handling, so that it will wait for a valid
response regardless of the wait condition.

Fixes #3980
2013-09-25 16:16:52 -05:00
Charles Blonde
4639295563 Update instance_profile_name message 2013-09-12 22:14:27 +02:00