Commit Graph

2869 Commits (83f42ecfd4784f4555055da4e4b5bd2bbcb04d1b)

Author SHA1 Message Date
Ryan Brown 7828b1adc1 Fixes: #4516 add placement_group argument for ec2_asg module (#5506) 9 years ago
einarc 8d1fe3b444 Avoid `TypeError` when desired_capacity is not provided to `ec2_asg` module (#5501)
Moving the "check if min_size/max_size/desired_capacity..." code to execute BEFORE the desired_capacity code is used in the following operation:
num_new_inst_needed = desired_capacity - len(new_instances)

Otherwise the following exception occurs when desired_capacity is not specified and you're replacing instances:
    num_new_inst_needed = desired_capacity - len(new_instances)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Stack Trace:

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg", line 3044, in <module>
    main()
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg", line 3038, in main
    replace_changed, asg_properties=replace(connection, module)
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg", line 2778, in replace
    num_new_inst_needed = desired_capacity - len(new_instances)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "ec2_asg"}, "module_stderr": "Traceback (most recent call last):\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg\", line 3044, in <module>\n    main()\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg\", line 3038, in main\n    replace_changed, asg_properties=replace(connection, module)\n  File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1478229985.74-62334493713074/ec2_asg\", line 2778, in replace\n    num_new_inst_needed = desired_capacity - len(new_instances)\nTypeError: unsupported operand type(s) for -: 'NoneType' and 'int'\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}
	to retry, use: --limit @
9 years ago
Patrick F. Marques afa1750105 Remove duplicated option from examples 9 years ago
Zaius Dr 135c70bdd8 Improve `ec2` module Python3 Support (#5497)
Imported six module from ansible module_utils for backwards compatibility.
9 years ago
Lars Van Casteren 00e64def78 Docs update for `os_security_group` (#5531)
The example used equal characters and not colon characters.
9 years ago
Andrew Gaffney d52d256196 Fix bare variable references in docs (#5554) 9 years ago
Ryan Brown 801f4f0bf4 Fix `cloudformation` error when stack-rollback fails (#5550)
In cases where a CFN stack could not complete (due to lack of
permissions or similar) but also failed to roll back, the gathering of
stack resources would fail because successfully deleted items in the
rollback would no longer have a `PhysicalResourceId` property.

This PR fixes that by soft-failing when there's no physical ID
associated to a resource.
9 years ago
Ryan S. Brown 4f83b809dc Fix doc examples for `ec2_elb_lb` module
The examples had the listeners as a list item for each param, when they
really need to be their own objects.
9 years ago
Ryan S. Brown 8cbb0dc13e Fail gracefully in `ec2_asg` module when there are no matching launch configurations 9 years ago
jctanner 2de97ac5bd replace type() with isinstance() (#5541)
Replace all use of type() with isintance()

Addresses https://github.com/ansible/ansible/issues/18310
9 years ago
Ryan S. Brown 45588171a8 Fix link in `cloudformation` module docs 9 years ago
Sean Summers aa5124af27 added requires for botocore with RoleARN support
Added a requires for the minimum botocore version required to support RoleARN
9 years ago
Sean Summers f31a71c4cf add role_arn to support Service Role
Add `role_arn` to support [AWS CloudFormation Service Role](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-servicerole.html)
9 years ago
Jason Cormie cbc3aac2f2 Addition of InstanceUUID to facts (#4424)
The Instance UUID(refered to as PersistenceUUID in the API) is a the ID
vcenter uses to idenify VMs.
My use case for this is that I configure Zabbix using ansible and its
vmware module relies on using these to identify VMs.
9 years ago
Yair Fried c953397fde Expose internal_network in os_floating_ip (#5510)
* Expose internal_network in os_floating_ip

Shade project has finally exposed this argument so now this module
matches old quantum_floatingip module's capabilities.

Use "nat_destination" term instead of "internal_network" to match shade
terminology.

* Add (private|internal)_network aliases to os_floating_ip

* Fix typo in os_floating_ip
9 years ago
mickael-ange 1ca20679dd Added aws and ec2 extends_documentation_fragment to cloud/amazon/rds module. (#3951) 9 years ago
Abel Boldú 9d07911b03 Add uplink provider type (#5282) 9 years ago
Eduard Iskandarov d856c67cde Fixes: #4516 add placement_group argument for ec2_asg module 9 years ago
Tom Melendez 94d28fbd6f Support for named_ports in Managed Instance Groups. A libcloud guard has been implemented, as this feature will only be available in libcloud >= 1.3, or by using trunk. (#5167) 9 years ago
Jesse Keating 4db6d47ef8 Add update_password argument to os_user (#5219)
There is a desire to not have this module always result in a change if a
password argument is supplied. The OpenStack API does not return a
password back when we get a user, so we've been assuming that if a
password argument was supplied, we should attempt to change the password
(even if nothing else is changing), and that results in a "changed"
state. Now we will only send along a password change attempt if the user
wants one (the default to match history).

Fixes #5217
9 years ago
Ricardo Carrillo Cruz 872a3822c2 Add rebuild support to os_server_actions (#4289)
Fixes #2714
9 years ago
Jamie Dyer e69e1ca2c8 Make the RDS endpoint available if AWS returns it. Fixes #3865 (#4143) 9 years ago
Brian Coca 859180d013 corrected version added 9 years ago
Brian Coca b8eb9769a3 added logout to docker_login
also cleaned up 'actions' and minor doc issues
9 years ago
Charles Paul 1163b4bb50 add id: back to documentation 9 years ago
John Baublitz 7cfe6df92e GCE: Add support for 'number' parameter for manually provisioned Google Compute clusters (#4276)
* Add option for number parameter to generate manually provisioned clusters from a base name

* Refactor code to work with starting and stopped when number is specified

* Update docs

* Fix documentation error breaking Travis

* Fixes for async gce operations

* Fix documentation

* base_name from parameter to alias for name and fixes for renaming variables

* Fix breaking change on gce.py

* Fix bugs with name parameter

* Fix comments for Github build checks

* Add logic to set changed appropriately for cluster provisioning
9 years ago
Ryan S. Brown 98f6019d86 Remove unused YAML import from cloudformation 9 years ago
Ryan Brown 23da0fc2b8 Support native YAML in CloudFormation module (#5327)
Support the new native YAML format in the CloudFormation API. This means
the existing `template_format` parameter is deprecated. This commit also
adds a warning for the deprecated parameter.
9 years ago
Daniel Andrei Minca ced24b7b03 fix unclear documentation for docker container
the docker container module's `exposed_ports` was slightly ambigous.

Use the official Docker documentation to define what an `exposed port`
is.

Resolves: ansible/ansible-modules-core#5303
Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
9 years ago
Ryan S. Brown cd9e39420b Fix cloudformation module return parameter documentation
Always return stack outputs, even if only an empty dict
9 years ago
tedder d8b015d9c8 Cloudformation module fix unintentional changed=true
- Don't rewrite the result; this is causing 'changed=true' on update
- Move AWSRetry import to top since it's a decorator, and is needed at definition-time
9 years ago
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
9 years ago
Ryan S. Brown d018a86f4f Fix `fail_json` invocation in `cloudformation` module 9 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.
9 years ago
Davis Phillips 2fdd869fd6 vsphere_guest: Set extra config and powerstate after template deploy (#4266)
* Fixes #1381
* Fixes #2971
* Fixes #3056
9 years ago
Michael Scherer 8853f6b6a4 Do not leak the password in log (#5203) 9 years ago
Michael Scherer 9718a58be4 Do not leak api_key or root password in log (#5201) 9 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
9 years ago
Tom Melendez c6d8cb6cab Added libcloud guard for Managed Instance Groups. (#4911) 9 years ago
Tom Melendez 454835622b GCE module examples update. Correct syntax, demonstrate other options and creation of multiple instances. (#5192) 9 years ago
John Barker 275fa3f055 Correct functional typos 9 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) 9 years ago
adejongh 32d7d31105 Fixed incorrect usage of user_data variable (#5194) 9 years ago
Elena Washington b4f6a25195 Make is so that the params param truly isn't required (fix for #3860) 9 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
9 years ago
Toshio Kuratomi de9dc9b58a Fix exception hierarchy for digital ocean and some cleanups of pep8 style
Fixes #4613
9 years ago
Chris Houseknecht 0156cb942e Surface Compose stdout on failure
Signed-off-by: Chris Houseknecht <chouseknecht@ansible.com>
9 years ago
Chris Houseknecht fba5883dd1 Improved enumeration of actions 9 years ago
Chris Houseknecht a10ce8ff25
Improved build and pull error handling 9 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
```
9 years ago