mirror of https://github.com/ansible/ansible.git
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.
819fe45864
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 | 10 years ago | |
_ec2_ami_search.py | 8 years ago | |
cloudformation.py | 8 years ago | |
ec2.py | 8 years ago | |
ec2_ami.py | 9 years ago | |
ec2_ami_find.py | 9 years ago | |
ec2_asg.py | 8 years ago | |
ec2_eip.py | 8 years ago | |
ec2_elb.py | 9 years ago | |
ec2_elb_lb.py | 8 years ago | |
ec2_facts.py | 8 years ago | |
ec2_group.py | 8 years ago | |
ec2_key.py | 9 years ago | |
ec2_lc.py | 8 years ago | |
ec2_metric_alarm.py | 9 years ago | |
ec2_scaling_policy.py | 9 years ago | |
ec2_snapshot.py | 9 years ago | |
ec2_tag.py | 9 years ago | |
ec2_vol.py | 9 years ago | |
ec2_vpc.py | 8 years ago | |
ec2_vpc_net.py | 8 years ago | |
elasticache.py | 9 years ago | |
elasticache_subnet_group.py | 9 years ago | |
iam.py | 8 years ago | |
iam_cert.py | 8 years ago | |
iam_policy.py | 8 years ago | |
rds.py | 8 years ago | |
rds_param_group.py | 9 years ago | |
rds_subnet_group.py | 9 years ago | |
route53.py | 9 years ago | |
s3.py | 9 years ago |