Commit graph

2787 commits

Author SHA1 Message Date
Ryan Brown
819fe45864 Fix failure when powering on/off EC2 instances by tag only. (#4767)
If you apply `wait=yes` and use `instance_tags` as your filter for
stopping/starting EC2 instances, this stack trace happens:

```
An exception occurred during task execution. The full traceback is:                                                                          │~
Traceback (most recent call last):                                                                                                           │~
  File "/tmp/ryansb/ansible_FwE8VR/ansible_module_ec2.py", line 1540, in <module>                                                            │~
    main()                                                                                                                                   │~
  File "/tmp/ryansb/ansible_FwE8VR/ansible_module_ec2.py", line 1514, in main                                                                │~
    (changed, instance_dict_array, new_instance_ids) = startstop_instances(module, ec2, instance_ids, state, instance_tags)                  │~
  File "/tmp/ryansb/ansible_FwE8VR/ansible_module_ec2.py", line 1343, in startstop_instances                                                 │~
    if len(matched_instances) < len(instance_ids):                                                                                           │~
TypeError: object of type 'NoneType' has no len()                                                                                            │~
                                                                                                                                             │~
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "ec2"}, "module_stderr": "Traceb│~
ack (most recent call last):\n  File \"/tmp/ryansb/ansible_FwE8VR/ansible_module_ec2.py\", line 1540, in <module>\n    main()\n  File \"/tmp/│~
ryansb/ansible_FwE8VR/ansible_module_ec2.py\", line 1514, in main\n    (changed, instance_dict_array, new_instance_ids) = startstop_instances│~
(module, ec2, instance_ids, state, instance_tags)\n  File \"/tmp/ryansb/ansible_FwE8VR/ansible_module_ec2.py\", line 1343, in startstop_insta│~
nces\n    if len(matched_instances) < len(instance_ids):\nTypeError: object of type 'NoneType' has no len()\n", "module_stdout": "", "msg": "│~
MODULE FAILURE", "parsed": false}
```

That's because the `instance_ids` variable is None if not supplied
in the task. That means the instances that result from the instance_tags
query aren't going to be included in the wait loop. To fix this, a list
needs to be kept of instances with matching tags and that list needs to
be added to `instance_ids` before the wait loop.
2016-09-09 19:38:05 -04:00
Abhijit Menon-Sen
55d51b3946 Fix spot instance creation by ignoring instance_initiated_shutdown_behavior (#4741)
Before this, all spot instance requests would fail because the code
_always_ called module.fail_json when the parameter was set (which it
always was, because the module parameter's default was set to 'stop').

As the comment said, this parameter doesn't make sense for spot
instances at all, so the error message was also misleading.
2016-09-08 12:33:36 -04:00
Florian Dambrine
aac55fcc62 Fix ec2 module source_dest_check when running on non VPC instances (EC2 Classic) (#3243) 2016-09-08 12:25:17 +02:00
Matt Ferrante
624f813f60 Properly support tag updates on CloudFormation stack-update actions (#3638) 2016-09-07 16:16:32 -04:00
David J Peacock
3bede24323 description expanded for 112, AKA VRRP protocol) (#4645)
* description expanded for 112, AKA VRRP protocol)

* corrected syntax for description for IP protocols
2016-09-07 12:30:03 -04:00
Kenny Woodson
269c06a4c9 Fix for validate rule. Ensure rule is a dict. (#4640) 2016-09-02 15:09:58 -04:00
Kenny Woodson
9b37dcb593 Getting rid of a None type error when no resource tags are defined. (#4638) 2016-09-02 11:54:27 -07:00
John R Barker
0c25e968ee digital_ocean_tag name is a required field
Spotted during final review of https://github.com/ansible/ansible-modules-core/pull/4218/files
Simple to change, so fixing post merge
2016-08-30 19:56:49 +01:00
Victor Volle
c170107eef Digitalocean tags (replaces #4209) (#4218)
* Fixes #4117: Add DigitalOcean Tag support

* Add GPLv3 license header and RETURN documentation

* ansible.module_utils.urls instead of "requests"
2016-08-30 19:54:46 +01:00
Arun prasath
0d98760b49 Fixes bug #4546 - Made password optional (#4574) 2016-08-30 11:16:43 -04:00
David J Peacock
8f963a7028 Fix #4412: os_security_group_rule support numbered protocols (#4444) 2016-08-30 10:55:16 -04:00
Ryan Brown
0c37949941 Remove spurious changed state on iam_policy module (#4381)
Due to a mixup of the group/role/user and policy names, policies with
the same name as the group/role/user they are attached to would never be
updated after creation. To fix that, we needed two changes to the logic
of policy comparison:

- Compare the new policy name to *all* matching policies, not just the
  first in lexicographical order
- Compare the new policy name to the matching ones, not to the IAM
  object the policy is attached to
2016-08-30 10:24:00 -04:00
Rick Mendes
02c47f5b0c Fixes #3144 (#4305) 2016-08-30 15:16:42 +02:00
Matías Pizarro
521c9a2e20 Use named parameters in new_droplet method call (#4483)
This mirrors the original method signature and guards against any
change in order parameter
2016-08-30 11:56:09 +02:00
Ilja Bauer
acb7d873f8 Replaced use of bare variables with full variable syntax (#4149) 2016-08-27 17:11:42 +02:00
chouseknecht
48941291c1
Fix container labels expected vs actual comparison. 2016-08-27 08:00:13 -04:00
Patrick Marques
f3c0c09fb6 ssh_public_keys on Azure virtual machine is a list (#4350)
The ssh_public_keys must be a list otherwise will give the error:
"argument ssh_public_keys is of type <type 'dict'> and we were unable to convert to list"
2016-08-25 15:08:54 -07:00
Richard Adams
c8ca1a6211 Add parameter to ec2 module to control instance shutdown behavior (stop|terminate) 2016-08-24 13:34:48 -04:00
Karthik Suresh
64ded1bb5e Removing duplicate name: parameter possible typo (#4525)
Removed name:parameter in documentation. Possible typo.
2016-08-24 11:04:59 -04:00
chouseknecht
42540ae510 Fix doc strings. Use of > was breaking HTML generation on docs site module page. 2016-08-23 16:17:56 -04:00
nishiokay
a24398d025 Add ipv6 paramater to digital_ocean module (#4447) 2016-08-19 09:07:47 +02:00
Linus Arver
74c8954d86 docker_service: fix files/project_files typo
The original decision to rename from `project_files' to `files' was in
3a5dd00076.
2016-08-17 14:50:27 -07:00
chouseknecht
95f69c55fa Exposing tcp and udp for same port fails. Fixes issue #4354. 2016-08-17 17:03:37 -04:00
Ryan Brown
8da5e2cb88 Merge pull request #4275 from shaunbrady/ec2_elb_lb_respect_vpc
Make ec2_elb_lb respect VPCs when resolving groups
2016-08-17 14:06:25 -04:00
PikachuEXE
997fa3b2b7 Allow specifying human readable value for option memory_limit again (#4049) 2016-08-16 08:44:24 -04:00
Ryan Brown
a2a6b5247f Merge pull request #4286 from rickmendes/fix-issue-4227
Clarify docs that led to #4227
2016-08-15 12:27:01 -04:00
chouseknecht
e7abbbf134 Fix network alias and network link comparison.
- Using set based comparison was not working consistently
  - With != operator worked locally but consistently failed on Travis
  - With 'not in' operator failed locally and on Travis
2016-08-12 18:01:11 -04:00
chouseknecht
4c3bf24ebf
If debug true, include actions and differences in output. 2016-08-12 12:14:34 -04:00
Chris Houseknecht
70806fcfe4 Some post merge clean up: (#4406)
- Removed required_if.
  - Fixed doc strings.
  - Removed debug output being appended to actions.
  - Put import of basics at bottom to be consistent with other docker modules
  - Added 'containers' alias to 'connected' param
  - Put facts in ansible_facts.ansible_docker_network
2016-08-12 10:40:46 -04:00
Brian Coca
decb2ec9fa doc fix 2016-08-12 09:53:57 -04:00
Chris Houseknecht
fdfdfe9017 Adding docker_network module. (#4404) 2016-08-12 09:52:37 -04:00
muxator
24fa1ab426 typo in the documentation of the "state" parameter (#4353) 2016-08-07 17:23:42 +02:00
Chris Houseknecht
0358dee095 Add buildargs parameter to support Dockerfile ARG directive. (#4349)
* Add buildargs parameter to support Dockerfile ARG directive.

* Fix doc_strings. Doc string for load_path was completely missing.
2016-08-05 19:14:31 -04:00
chouseknecht
cc101164a8
Default repository tag value to tag parameter value or 'latest'. 2016-08-05 16:08:11 -04:00
chouseknecht
d36f04e7f2 Always returns changed when state present and name includes :tag. 2016-08-05 14:29:06 -04:00
Chris Houseknecht
c0d373f258 Add *build* to state parameter choices. Updated deprecation message. Will be deprecated in release 2.3. Removed (#4342)
mention of *tagged* state in the force parameter doc strings. There is no *tagged* state.
2016-08-05 10:47:29 -04:00
chouseknecht
c27054090a Fix image tag operation. Allows repository in form of repo:tag. If no tag value, defaults to 'latest'. 2016-08-05 05:08:52 -04:00
Ryan Brown
95a7ee271a Merge pull request #3773 from jbaublitz/gce_net_nwmode
gce_net: Add ability to create new-style networks on Google Cloud
2016-08-04 14:22:35 -04:00
chouseknecht
af177834af
Added implementation of ignore_image, which prevents recreation of containers on image change. 2016-08-03 16:30:45 -04:00
Chris Houseknecht
ccd8cd014b Merge pull request #4313 from chouseknecht/devel
Bind published ports to specific host IP when one is available
2016-08-03 13:51:01 -05:00
chouseknecht
74dbb61b8d Fix #3670 host IP defaults to 0.0.0.0 ignoriing bridge Host IP option. 2016-08-03 14:47:30 -04:00
Chris Houseknecht
db66758125 Merge pull request #4308 from chouseknecht/devel
Add explicit image build
2016-08-02 23:53:48 -05:00
chouseknecht
18343c4e5a
Improved documentation for returned actions. 2016-08-03 00:39:21 -04:00
chouseknecht
b9696a349f
When build true call docker-compose build, and add nocache option. 2016-08-03 00:25:58 -04:00
Chris Houseknecht
3b268eff79 Merge pull request #4307 from chouseknecht/devel
Adding pull option
2016-08-02 21:32:32 -05:00
chouseknecht
81b3022eb5
Set version_added 2016-08-02 22:22:55 -04:00
chouseknecht
7e93dbb264
Add pull option to pull images prior to evaluating service state. 2016-08-02 22:20:48 -04:00
Shawn Siefkas
ec87c517c1 Check mode fixes for ec2_vpc_net module (#2179)
* Check mode fixes for ec2_vpc_net module

Returns VPC object information

Detects state change for VPC, DHCP options, and tags in check mode

* Early exit on VPC creation in check mode
2016-08-02 13:39:27 -07:00
Shawn Siefkas
380dbd4369 Fix #2526 (#2527)
Fail on unhandled exception in ec2_asg rather than raise
2016-08-02 13:37:01 -07:00
Shawn Siefkas
528f9a1d0b Check mode fix for ec2_group module (#2184)
The default VPC egress rules was being left in the egress rules for
purging in check mode.  This ensures that the module returns the correct
change state during check mode.
2016-08-02 13:01:48 -07:00