"Maybe I missed something, but how do I have a custom inventory declare a
variable global to all hosts in every group? "

You can set a variable on the 'all' group and it will be available to all
groups, but override-able in child groups.    This is probably what you
want to do.







On Sat, Aug 30, 2014 at 7:49 PM, Andrew Cholakian <[email protected]>
wrote:

> Michael thanks for the response!
>
> Maybe I missed something, but how do I have a custom inventory declare a
> variable global to all hosts in every group? I should mention I'm actually
> using ec2.py right now, and I'm comfy using that. The docs are a little
> confusing to me on this point.
>
>
> On Tue, Aug 26, 2014 at 5:43 PM, Michael DeHaan <[email protected]>
> wrote:
>
>> Note that lookup plugins will get executed once per host, it may be
>> better to download it once from s3 and then load it via a lookup plugin to
>> avoid s3 hammering.
>>
>> You could really put the file anywhere you want, though something outside
>> of your git directory seems wise, or otherwise configure .gitignore
>>
>> Yes, a structure could look like this:
>>
>> {{ lookup('file', '/path/to/file') | to_json }}
>>
>> I don't know how complex your infrastructure is, but you may also wish to
>> consider a custom inventory plugin that loads in those variables instead -
>> it would be easier, and *PERHAPS* more appropriate.
>>
>> But if you have a small infrastructure maybe not.  If you are trying to
>> model a large MSP environment, absolutely.
>>
>>
>>
>>
>>  On Tue, Aug 26, 2014 at 12:03 PM, Andrew Cholakian <[email protected]>
>> wrote:
>>
>>>  I need to use a custom lookup plugin to pull our JSON customer
>>> database from s3. I have two questions:
>>>
>>> 1. Where in the file structure should the file go
>>> 2. Can a lookup plugin return a complex type like a hash?
>>>
>>> Thanks in advance!
>>>
>>> --
>>> 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].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/73fb218f-6ee8-4afc-a335-0cdab3455053%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/73fb218f-6ee8-4afc-a335-0cdab3455053%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 a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/lTdnkFQlYa8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>>
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxuAtoL93yn2sDHw%2BQ%3D5cTHmEuFVeMuZOnU6m-0HpMN_g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxuAtoL93yn2sDHw%2BQ%3D5cTHmEuFVeMuZOnU6m-0HpMN_g%40mail.gmail.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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAOyM9bWORymd6jOormnXXs9-fE0FdyiM%2BsUVgDJTrXDidP_WfQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAOyM9bWORymd6jOormnXXs9-fE0FdyiM%2BsUVgDJTrXDidP_WfQ%40mail.gmail.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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyzf83e61dnqCbTOSBs5rJ%3DFXKWzgdCURNW5t%2BMDvu4uA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to