-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ansible 2.0] from dynamic inventory, groups showing as hosts #13655
Comments
and without hosts and vars Without this patch, the simplified syntax is triggered when a group is defined like this: "platforms": { "children": [ "cloudstack" ] } Which results in a group 'platforms' with 1 host 'platforms'. more details in ansible#13655
This commit removed 'children' from this line Also this issue has been resolved before? A possible workaround to the dynamic inventory script could be to add a 'vars' key with empty dict as value {} but I don't know any other implications of this... so yeah.
|
ansible/ansible#13655 ... where groups gets added as hosts to the inventory. That does not happen if group has vars defined, so we give all groups at least an empty dict of vars.
@nflx Your fix in the ansible-inventory module you're using is perfect. The dynamic inventory that I'm using is internal and highly customized for our environment, but this workaround should be easy to implement. Plus, that implementation gives me great ideas to add to our dynamic inventory. Thanks! |
and without hosts and vars Without this patch, the simplified syntax is triggered when a group is defined like this: "platforms": { "children": [ "cloudstack" ] } Which results in a group 'platforms' with 1 host 'platforms'. more details in #13655
did this bug get missed. it looks like it was marked for the stable milestone, and 2.0 is released https://www.ansible.com/blog/ansible-2.0-launch and this still exists. I have a pretty simple script generating something like.
which broke, but when I added the "vars": {} line fixed it
Im pretty glad I came across this issue because I had no idea why things all of a sudden just broke so badly. all of the configs that were attached to the host "ephemeral" all of a sudden did not work, since it was actually trying to resolve that as a host name. |
@senorsmile Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. Here are the items we could not find in your description:
Please set the description of this issue with this template: |
I updated the original request and retested from git several different versions of 2.0.x. It appears that as of 2.0.1 this bug is no longer present. I have tested it is NOT present on:
Since it seems to have been incidentally fixed in 2.0.1, marking this as closed. |
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
We are noticing some errors while testing on ansible v2.0 (now rc3), where "sub-groups" are being mentioned as failing nodes.
I have narrowed this down to a reproducible case. Note that it does NOT happen with "subgroups" in a plain hosts file. Only when coming from a dynamic inventory script.
Say you have the following output from your dynamic inventory:
now, try to run e.g.
Under ansible 1.9.4 you will only get the hosts.
In 2.0 you get the hosts PLUS group1_1.
I have narrowed this down a bit.
It did NOT happen at this commit:
A couple of unworking merges later, it starts happening:
I have not yet been able to track down the issue in code. This has been reproduced on multiple machines and Mac OS and Ubuntu 14.04.
The text was updated successfully, but these errors were encountered: