Commit Graph

2838 Commits (f040d63403f6c459a278918fa48fa8cb87754506)

Author SHA1 Message Date
tedder f040d63403 Boto3 rewrite of cloudformation module
- removed star-imports, which wasn't possible in Ansible 1.x
- boto doesn't have any of the modern features (most notably, changesets), so this rewrite goes all-in on boto3.
- tags are updateable, at least in boto3. Fix documentation.
- staying with "ansible yaml to json conversion" because I'm trying to keep this scoped properly. The next PR will have AWS-native yaml support.
- documented the output. Tried to leave it backwards-compatible but the changes to 'events' might break someone's flow. However, the existing data wasn't terribly useful so I don't assume it will hurt.
- split up the code into functions. This should make unit testing possible.
- added forward-facing code: 'six' for iterating, started using AWSRetry, common tag conversion.
- add todo list
- Pass `exception` parameter to fail_json
8 years ago
Ryan S. Brown d018a86f4f Fix `fail_json` invocation in `cloudformation` module 8 years ago
Ricardo Carrillo Cruz 500736d301 Refactor domain/project handling on os_user module (#5212)
The keys returned by user objects for default domain and
default project are respectively default_domain_id and
default_project_id.
We need to gather those IDs in case the user passed names, so we
can then compare with the user object on the needs_update helper
function.
8 years ago
Davis Phillips 2fdd869fd6 vsphere_guest: Set extra config and powerstate after template deploy (#4266)
* Fixes #1381
* Fixes #2971
* Fixes #3056
8 years ago
Michael Scherer 8853f6b6a4 Do not leak the password in log (#5203) 8 years ago
Michael Scherer 9718a58be4 Do not leak api_key or root password in log (#5201) 8 years ago
John R Barker 312f578f93 Bulk spelling improvement to modules-core (#5225)
* Correct spelling mistakes

* Correct more spelling issues

* merge conflict

* Revert typo in parms
8 years ago
Tom Melendez c6d8cb6cab Added libcloud guard for Managed Instance Groups. (#4911) 8 years ago
Tom Melendez 454835622b GCE module examples update. Correct syntax, demonstrate other options and creation of multiple instances. (#5192) 8 years ago
John Barker 275fa3f055 Correct functional typos 8 years ago
jjshoe 745b1857d6 Catch the rare condition where ami creation failed, this is critical when you have a 10-15 minute wait on ami creation. This rarely happens, and is tough to reproduce, but it does happen. (#5106) 8 years ago
adejongh 32d7d31105 Fixed incorrect usage of user_data variable (#5194) 8 years ago
Elena Washington b4f6a25195 Make is so that the params param truly isn't required (fix for #3860) 8 years ago
Toshio Kuratomi 7e19d375b3 Emit an error message if six is not installed.
dopy 0.3.7 makes use of six but doesn't list it as a requirement.  This
means that people installing with pip won't get six installed, leading
to errors.  Upstream released dopy-0.3.7a to address that but pip thinks
that is an alpha release.  pip does not install alpha releases by
default so users aren't helped by that.

This change makes ansible emit a good error message in this case.

Fixes #4613
8 years ago
Toshio Kuratomi de9dc9b58a Fix exception hierarchy for digital ocean and some cleanups of pep8 style
Fixes #4613
8 years ago
Chris Houseknecht 0156cb942e Surface Compose stdout on failure
Signed-off-by: Chris Houseknecht <chouseknecht@ansible.com>
8 years ago
Chris Houseknecht fba5883dd1 Improved enumeration of actions 8 years ago
Chris Houseknecht a10ce8ff25
Improved build and pull error handling 8 years ago
Ryan Brown f1c2739163 Handle termination_protection parameter when restarting instances (#5076)
* Restart EC2 instances with multiple network interfaces

A previous bug, #3234, caused instances with multiple ENI's to fail when being
started or stopped because sourceDestCheck is a per-interface attribute, but we
use the boto global access to it (which only works when there's a single ENI).

This patch handles a variant of that bug that only surfaced when restarting an
instance, and catches the same type of exception.

* Default termination_protection to None instead of False

AWS defaults the value of termination_protection to False, so we don't
need to explicitly send `False` when the user hasn't specified a
termination protection level. Before this patch, the below pair of tasks
would:

1. Create an instance (enabling termination_protection)
2. Restart that instance (disabling termination_protection)

Now, the default None value would prevent the restart task from
disabling termination_protection.

```
- name: make an EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    instance_type: t2.micro
    termination_protection: yes
    exact_count: 1
    count_tag:
       Name: TestInstance
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
- name: restart a protected EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    state: restarted
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
```
8 years ago
Chris Houseknecht 90af27f20f Merge pull request #5050 from chouseknecht/devel
Fix intermittent image push error
8 years ago
Pradeep 4cb27d914f Typo Fix 8 years ago
Ryan Brown 75507e7569 Check status of finished spot instance requests (#4990)
Per #3877, the code to wait for spot instance requests to finish would
hang for the full wait time if any spot request failed for any reason.
This commit introduces status checks for spot requests, so if the
request fails, finishes, or is cancelled the task will fail/succeed
accordingly.

One edge case introduced here is tha if a user terminates the instance
associated with the request manually it won't fail the play, under the
presumption that the user *wants* the instance terminated.
8 years ago
David Shrewsbury 7994115bbc Fix os_network's create_network() call for older shade versions (#5058)
A value for the project_id parameter to shade's create_network()
call was always being sent, even if no value for 'project' was
supplied. This was breaking folks with older versions of shade
(< 1.6).

Fixes PR https://github.com/ansible/ansible-modules-core/issues/3567
8 years ago
Chris Houseknecht c03697c81e Merge pull request #4961 from shaung/iss4504
Fix #4504 Respect timeout option when starting/stopping/restarting co…
8 years ago
Chris Houseknecht 523780a7ca Let docker-py handle decoding and JSON parsing of stream data. Fixes #4930. 8 years ago
Chris Houseknecht 84020b39ee Put requested devices in correct format to enable config comparison. Fixes #5000. 8 years ago
Chris Houseknecht e0aede1266 Merge pull request #4825 from adityamarella/devel
Docker module: add support for OomScoreAdj
8 years ago
Denis Tiago b2c6d39bec fix health instances count when we have more than one lb in asg 8 years ago
Ryan S. Brown 0f505378c3 Accept JSON type as the content of policy_json parameter on `iam_policy` module 8 years ago
shaung 4e9e546ef0 Fix #4504 Respect timeout option when starting/stopping/restarting containers. 8 years ago
David Shrewsbury 4bd2a409e6 Correct reuse_fips param to reuse_ips (#4939)
This new parameter was incorrectly named. Fixing to match the expected
name in the shade library.
8 years ago
Chris Houseknecht 16c9597ca7 Merge pull request #4943 from chouseknecht/devel
Improve error handling in docker_service module
8 years ago
René Moser 19be0da3b0 iam_cert: remove choice list for dup_ok type bool (#4940)
See 8879931f0c
8 years ago
Chris Houseknecht 4a560d4a15
Cast scale value to int. Fixes #4592. 8 years ago
Chris Houseknecht 5ab1a6f88d
Make project start and stop error handling more resilient, and improve message text. 8 years ago
indispeq 20e08b2cdf Fix openstack security group rule vrrp choice apostrophe error (#4750)
Fixes #4444 that was erroneously closed and thought fixed
8 years ago
Matt Clay f2c2dddc01 Remove duplicate keys from module docs. (#4920) 8 years ago
Harnek Sidhu 1df235f8ca Created digital_ocean_block_storage module (#4469) 8 years ago
Tom Melendez 922aed148d Support for GCE Managed Instance Groups. (#4541)
Create, Delete, Resize and Recreate (of instances) supported.  Autoscalers are also supported.
8 years ago
Ryan S. Brown a435dbbb2d Fix version_added for ec2_asg feature 8 years ago
Shawn Siefkas a29fb59a72 Adding SNS notification support to ec2_asg module
Addresses #1844
8 years ago
Ryan Brown 2e1e3562b9 Stop sorting of termination_policies in `ec2_asg` (#4883)
The AWS API requires that any termination policy list that includes
`Default` must end with Default. The attribute sorting caused any list
of attributes to be lexically sorted, so a list like
`["OldestLaunchConfiguration", "Default"]` would be changed to
`["Default", "OldestLaunchConfiguration"]` because default is earlier
alphabetically. This caused calls to fail with BotoServerError per #4069

This commit also adds proper tracebacks to all botoservererror fail_json
calls.

Closes #4069
8 years ago
Tom Melendez e92db1dc12 Document ability to disable external IP with 'none' setting. Closes #2562. (#4878) 8 years ago
Monty Taylor 4840d30589 Expose the reuse_fips flag on os_server (#4849)
* Expose the reuse_fips flag on os_server

* Remove useless line
8 years ago
mzizzi 48d932643b cloudformation stack events itertools.imap bugfix (#4868) 8 years ago
Aditya Marella bee0aeaf86 Docker module: add support for OomScoreAdj
* docker-py param name oom_score_adj
* translates to OomScoreAdj in the docker remote API
* setting version_added to "2.2"
8 years ago
Christopher Kotfila 2632aa630f Unpack AWS reservations while waiting to terminate (#4012)
Previously calculation of the number of instances that have been
terminated assumed all instances were in the first reservation returned
by AWS.  If this is not the case the calculated number of instances
terminated never reaches the number of instances and the module always
times out. By unpacking the instances we get an accurate number and the
module correctly exits.
8 years ago
Ryan Brown ae6992bf8c Handle EC2 instances with multiple network interfaces (#4766)
Currently instances with multiple ENI's can't be started or stopped
because sourceDestCheck is a per-interface attribute, but we use the
boto global access to it (which only works when there's a single ENI).

This patch handles multiple ENI's and applies the sourcedestcheck across
all interfaces the same way.

Fixes #3234
8 years ago
Chris Houseknecht de0122fdaf
Set default log_driver to None to prevent config comparison when a log_driver is not specified. Fixes #4600. 8 years ago
Chris Houseknecht 0d43a01462 Purge networks using network name rather than ID. Fixes 4596. 8 years ago