I am confused why you have group definitions inside a file that seems to
describe a host.

Should the "hosts/" directory just be named "inventory" ?

Anyway, yes, if you feed -i a path to a directory, it will load all
inventory sources therein.

It is however true there are some unmerged things that will address what
happens when the individual inventory files have information overlap.  svg
worked on this and it's in queue after we smite some other various buglets.




On Wed, May 28, 2014 at 9:56 AM, Joost Cassee <jo...@cassee.net> wrote:

> Hi all,
>
> [Sorry for the barrage of mails, I am restructuring my Ansible layout and
> running into several things at once.]
>
> I thought it was possible to combine inventory sources like this:
>
> hosts/static1
> ---
> [group1]
> host1
>
> hosts/static2
> ---
> [group2]
> host1
>
> test.yml
> ---
> - hosts: all
>   connection: local
>   gather_facts: no
>   tasks:
>   - debug: var=hostvars
>
> It looks like group1 is somehow masking group2 during limiting:
>
> $ ansible-playbook test.yml -i hosts -l group1
>
> PLAY [all]
> ********************************************************************
>
> TASK: [debug var=group_names]
> *************************************************
> ok: [host1] => {
>     "group_names": [
>         "group1",
>         "group2"
>     ]
> }
>
> $ ansible-playbook test.yml -i hosts -l group2
> ERROR: provided hosts list is empty
>
> Is this a bug?
>
> Regards,
> Joost
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/06798cc1-c530-4c90-9f25-e726ffe20cc2%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/06798cc1-c530-4c90-9f25-e726ffe20cc2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxjEJwmu3Lfub1pdJYMt8Z%3DgyaRbYEKKibLNcR8YyJmhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to