It seems you found a bug...
On Sat, Feb 20, 2016 at 1:44 PM, Bruce Freeman <[email protected]>
wrote:
> I'm seeing a difference in dynamic inventory between 1.9.4 and 2.0 but
> what we have seems to be correct according to the documentation.
>
> Here is a simple Shell script to demonstrate:
>
> #!/bin/sh
> cat <<!
> {
> "fooservers": {
> "children": [ "fooA", "fooB" ]
> },
> "fooA": [ "host1" ],
> "fooB": [ "host2" ]
> }
> !
>
> If I put this in a directory as inventory/test.sh then I see the following:
>
> With Ansible 1.9.4:
>
> $ ansible --version
> ansible 1.9.4
> configured module search path = None
> $ ansible --list-hosts -i inventory fooservers
> host1
> host2
>
> With Ansible 2.0:
>
> $ ansible --version
> ansible 2.0.0.2
> config file = /var/tmp/playbook/ansible.cfg
> configured module search path = Default w/o overrides
> $ ansible --list-hosts -i inventory fooservers
> hosts (1):
> fooservers
>
> It looks like in 2.0 the group of groups isn't getting expanded. Did the
> syntax of how children get specified change in 2.0?
>
> I discovered that if I add an empty hosts or vars then it works:
>
> #!/bin/sh
> cat <<!
> {
> "fooservers": {
> "hosts": [ ],
> "children": [ "fooA", "fooB" ]
> },
> "fooA": [ "host1" ],
> "fooB": [ "host2" ]
> }
> !
>
> $ ansible -i inventory --list-hosts fooservers
> hosts (2):
> host1
> host2
>
>
> -- Bruce
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/0bd5c192-f120-4c60-a7b4-c43dac858881%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0bd5c192-f120-4c60-a7b4-c43dac858881%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
----------
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CACVha7c1AbNBTxXDpYyF872HhG7cKrsM%3Dds1aWi51hkSJ%2Be3vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.