group_vars - is this supported?

63 views
Skip to first unread message

Tennis Smith

unread,
Nov 6, 2014, 4:59:08 PM11/6/14
to ansible...@googlegroups.com


Can group_vars have nested sub-directories?  For example, can I have directories for groups "group_one" and "group_two" like this:

group_vars/
     all
     group_one
/
         all
         foo
         bar
     group_two
/
         all
         foo
         bar



Thanks,
-T

      

Serge van Ginderachter

unread,
Nov 7, 2014, 3:09:22 AM11/7/14
to ansible...@googlegroups.com
Yes, up to one level.

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8539c082-f722-4c33-a656-db8b16aaf39d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tennis Smith

unread,
Nov 7, 2014, 10:56:33 AM11/7/14
to ansible...@googlegroups.com


Thanks for the reply.

I'm not sure what "one level" means.  If I read the docs correctly, the group_vars dir can (should?) be inside the inventory directory.  If that is true, then how can one level work?

-T

Michael DeHaan

unread,
Nov 7, 2014, 11:03:45 AM11/7/14
to ansible...@googlegroups.com
One level means

group_vars/foo.yml

or group_vars/foo/a.yml and group_vars/foo/b.yml

is ok

group_vars/foo/some_directory/a.yml

will not find the data in a.yml



--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

Serge van Ginderachter

unread,
Nov 7, 2014, 11:06:42 AM11/7/14
to ansible...@googlegroups.com
On 7 November 2014 16:56, Tennis Smith <ten...@nextgxdx.com> wrote:
I'm not sure what "one level" means.  

​I mean, for a group 'tomcat' you can have a file tomcat, OR a dirctory tomcat. You cannot have another directory beneath tomcat.​

 
If I read the docs correctly, the group_vars dir can (should?) be inside the inventory directory.  If that is true, then how can one level work?

​group_vars should be in the inventory directory yes.​
 


Tennis Smith

unread,
Nov 7, 2014, 11:30:04 AM11/7/14
to ansible...@googlegroups.com
Thanks, guys.
-T
Reply all
Reply to author
Forward
0 new messages