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.
 
 
 
 
 
Go to file
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
.github Update GitHub templates to reflect ansible/ansible (#3900) 9 years ago
cloud Fix failure when powering on/off EC2 instances by tag only. (#4767) 8 years ago
commands Fixes ansible/ansible#15922 (#3793) 8 years ago
database Fix database table quoting in privileges_unpack() (#3858) 8 years ago
files Ensure unicode characters in zip-compressed filenames work correctly (#4702) 8 years ago
inventory Add missing GPLv3 License header 9 years ago
network minor updates to junos_package module for 2.2 (#4761) 8 years ago
packaging Python 3 fixes for apt_* modules. (#4754) 8 years ago
source_control to_text, to_bytes, and to_native now have surrogate_or_strict error handler (#4630) 8 years ago
system Add support for selinux_boolean_sub conversion (#4570) 8 years ago
test Only run integration script if it exists. 8 years ago
utilities updated include_role docs 8 years ago
web_infrastructure Fix change status on django_manage collectstatic. (#4239) 8 years ago
windows fix async_wrapper start suspended race (#4718) 8 years ago
.gitignore Add basic top level files. 10 years ago
.travis.yml We've decided that pythn 3.5 is the minimum python3 version (#4572) 8 years ago
CONTRIBUTING.md Fix broken link for issue template (#3680) 9 years ago
COPYING Add basic top level files. 10 years ago
README.md readme: add build state image from travis 9 years ago
VERSION Version bump for new beta 2.0.0-0.5.beta3 9 years ago
__init__.py package files 10 years ago
shippable.yml Add python3 testing for module PRs. (#4629) 8 years ago
test-docs.sh Add testing of docs to the core repo 10 years ago
test-requirements.txt add some unit tests for the os_server module 9 years ago

README.md

Build Status

ansible-modules-core

This repo contains Ansible's most popular modules that are shipped with Ansible.

New module submissions for modules that do not yet exist should be submitted to ansible-modules-extras, rather than this repo.

Take care to submit tickets to the appropriate repo where modules are contained. The docs.ansible.com website indicates this at the bottom of each module documentation page.

Reporting bugs

Take care to submit tickets to the appropriate repo where modules are contained. The repo is mentioned at the bottom of module documentation page at docs.ansible.com.

Testing modules

Ansible module development guide contains the latest info about that.

License

As with Ansible, modules distributed with Ansible are GPLv3 licensed. User generated modules not part of this project can be of any license.

Installation

There should be no need to install this repo separately as it should be included in any Ansible install using the official documented methods.