Gah, it's clearly staring me in the face but I'm just not getting it 
(sorry!).

So using your example Michael, let's say I want to define a hash called '
proxy_details' which, in each inventory, will hold different values for the 
same hash keys:

For my stage and production inventories it will look like this:

proxy_details: [http_proxy_host: abc.def.com, http_proxy_port: 80]

and for my development inventory it would look like this:

proxy_details: [http_proxy_host: zyx.wvu.com, http_proxy_port: 8080]

Where in your example would I define these hashes? (i.e. in which files and 
in which folders)

Cheers!


On Friday, January 24, 2014 2:33:49 PM UTC, Michael DeHaan wrote:
>
> Sure!
>
> /some/dir/inventory
>     production
>     stage
>     development
>     group_vars/
>         all
>         webservers
>     host_vars/
>          xyz.example.com
>
> etc
>
>
>
>
> On Fri, Jan 24, 2014 at 9:30 AM, Edd Grant <[email protected]<javascript:>
> > wrote:
>
>> Thanks Michael, Sorry though, I'm afraid you've lost me, I'm not sure 
>> quite what you mean. Could you give an example?
>>
>>
>> On 24 January 2014 14:23, Michael DeHaan 
>> <[email protected]<javascript:>
>> > wrote:
>>
>>> You don't have to put your production and development environment files 
>>> in different directories, just give them different names.
>>>
>>>
>>> On Fri, Jan 24, 2014 at 8:58 AM, Edd Grant <[email protected]<javascript:>
>>> > wrote:
>>>
>>>> Thanks Brian, I'm not sure I quite follow. Are you saying that I should 
>>>> be splitting my vars files up per-inventory? e.g.
>>>>
>>>> production/
>>>>   production.ini
>>>>   host_vars/
>>>>   group_vars/
>>>>     webservers.yml
>>>>     all.yml
>>>>
>>>> development/
>>>>   production.ini
>>>>   host_vars/
>>>>   group_vars/
>>>>     webservers.yml
>>>>     all.yml
>>>>
>>>> If I do this then won't I have to duplicate my group_vars files across 
>>>> each inventory folder? Is that considered Idiomatic usage? I'm asking as 
>>>> I've tried to follow the best 
>>>> practices<http://docs.ansible.com/playbooks_best_practices.html#how-to-arrange-inventory-stage-vs-production>page
>>>>  for layout and I haven't noticed a layout that resembles your 
>>>> suggestion.
>>>>
>>>> Cheers. 
>>>>
>>>> On Friday, January 24, 2014 1:42:06 PM UTC, Brian Coca wrote:
>>>>>
>>>>> that is just an organizational issue host_vars and group_vars are 
>>>>> relative to current inventory,
>>>>>
>>>>> inventory1/
>>>>>   hosts
>>>>>    group_vars/all
>>>>>
>>>>> inventory2/
>>>>>   hosts
>>>>>   group_vars/all
>>>>>
>>>>  -- 
>>>> 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] <javascript:>.
>>>>
>>>> To post to this group, send email to 
>>>> [email protected]<javascript:>
>>>> .
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Michael DeHaan <[email protected] <javascript:>>
>>> CTO, AnsibleWorks, Inc.
>>> http://www.ansibleworks.com/
>>>
>>>  -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "Ansible Project" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/ansible-project/NbZkalvBt08/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> [email protected] <javascript:>.
>>>
>>> To post to this group, send email to 
>>> [email protected]<javascript:>
>>> .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> -- 
>> Web: http://www.eddgrant.com
>> Email: [email protected] <javascript:>
>> Mobile: +44 (0) 7861 394 543
>>
>>  -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Michael DeHaan <[email protected] <javascript:>>
> CTO, AnsibleWorks, Inc.
> http://www.ansibleworks.com/
>
>  

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to