Perhaps I'm not understanding the question, but:

group_vars/all
group_vars/groupname1
group_vars/groupname2

etc

This can be used with multiple inventory files if group_vars is a directory
in the directory with both of them, which should be what you need.

Let us know if this doesn't make sense and perhaps I can elaborate further.

Thanks!


On Mon, Jul 7, 2014 at 12:11 AM, Chengbing Liu <lcbabc12...@gmail.com>
wrote:

> I'm using Ansible to deploy and maintain Hadoop clusters.
>
> I used to define variables in group_vars/all as shown below:
>
> hadoop:
>>
>> # Variables for core-site.xml
>>   nameservice: hadoop-namenode
>>
>> # Variables for hdfs-site.xml
>>   dfs_blocksize: 256m
>>
>> # Variables for mapred-site.xml
>>   mapred_job_tracker: hadoop-jobtracker:8021
>
>
>
> However, I have different inventory files, which makes it prone to
> mistakes.
>
> I can define variables using [all:vars] in inventory files:
>
> [all:vars]
>> hadoop_nameservice=hadoop-namenode
>>
>
>
> How can I define inventory-specific variables, while still preserving the
> structured definition as in group_vars/all?
>
> Thanks a lot!
>
> --
> 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/a62a724b-d9db-4bb0-980d-91efff5c869b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a62a724b-d9db-4bb0-980d-91efff5c869b%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%2BnsWgwf5iZU-CdxaHRJnVsH0_ez8JPzYPy1h1m5qXoMwyDDwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to