Hello everybody,

our current configuration management system uses a path notation for
hierarchical hostgroups (subgroups), i.e.

testgroup
testgroup/subgroup1
testgroup/subgroup2

which would correspond to Ansible's

[testgroup:children]
testgroup/subgroup1
testgroup/subgroup2

[testgroup/subgroup1]

[testgroup/subgroup2]

While using a dynamic inventory source for adapting the legacy inventory,
(Ansible does not care about the slash '/' in a group name), we ran into
problems declaring group variables via .yml-files on the filesystem:

group_vars/test/subgroup1/somevars.yml

is found by hosts in any of the above hostgroups, since Ansible
searches for all yml-files below group_vars/test/ and assigns their variables
to every host in the 'test' group.

One way around this problem might be to "flatten" the group tree by
replacing the '/' by '_' in the dynamic inventory source. Apart from 
possible (though unlikely) naming conflicts, this would be quite ugly 
abanding not only a quite nice notation for subgroups but also the 
much cleaner organisation of files and directories below group_vars.

Is there an alternative apart from rewriting Ansible's part of parsing 
the group_vars directories?

Many thanks in advance,
Gregor

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to