You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/cloud/amazon
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.
8 years ago
..
__init__.py added __init__.py to new cloud subcategories so builds work again 10 years ago
_ec2_ami_search.py Fix for #16518 - added missing regions 8 years ago
cloudformation.py Properly support tag updates on CloudFormation stack-update actions (#3638) 8 years ago
ec2.py Fix failure when powering on/off EC2 instances by tag only. (#4767) 8 years ago
ec2_ami.py added missing colons to documentation (#3913) 9 years ago
ec2_ami_find.py Merge pull request #3077 from jjshoe/devel 9 years ago
ec2_asg.py Fix #2526 (#2527) 8 years ago
ec2_eip.py Fixes #3144 (#4305) 8 years ago
ec2_elb.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_elb_lb.py Merge pull request #4275 from shaunbrady/ec2_elb_lb_respect_vpc 8 years ago
ec2_facts.py Fix for #16518 - added missing regions 8 years ago
ec2_group.py Fix for validate rule. Ensure rule is a dict. (#4640) 8 years ago
ec2_key.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_lc.py Improve documentation on security_groups-option 8 years ago
ec2_metric_alarm.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_scaling_policy.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_snapshot.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_tag.py Add more example on how to use module ec2_tags to list tags on an ins… (#3530) 9 years ago
ec2_vol.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
ec2_vpc.py Getting rid of a None type error when no resource tags are defined. (#4638) 8 years ago
ec2_vpc_net.py Check mode fixes for ec2_vpc_net module (#2179) 8 years ago
elasticache.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
elasticache_subnet_group.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
iam.py Merge pull request #3863 from ryansb/iam-pass-module 8 years ago
iam_cert.py Enforce boolean type for dup_ok 8 years ago
iam_policy.py Remove spurious `changed` state on iam_policy module (#4381) 8 years ago
rds.py Add default port for aurora (#4102) 8 years ago
rds_param_group.py Add support for PostgreSQL 9.5 in rds_param_group (fix for #3846) 9 years ago
rds_subnet_group.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 9 years ago
route53.py Add an example to delete Route53 alias record set (#3834) 9 years ago
s3.py Add s3_url requirement in doc when rgw support is enabled in s3.py 9 years ago