Hi,

You can use the magic variable inventory_dir and use it in your playbook. 
Here's the default value:

ansible -m debug -a var=inventory_dir localhost 
localhost | SUCCESS => { 
   "inventory_dir": "/etc/ansible" 
}

Regards,

Yannig

Le lundi 9 mai 2016 11:13:31 UTC+2, Krzysztof Zarzycki a écrit :
>
> Hi! 
> Is it possible to store files or templates per inventory? Similar to how 
> we can store group_vars per inventory.
> I often hit the issue with Ansible, that I would like to store a file or a 
> template per inventory (TEST, PROD). These usually are large configuration 
> files of some components (like Hadoop), that are almost completely 
> different per inventory and have so many variables, that it seems worthless 
> to create shell-like templates with a lot of variables in it. Especially, 
> that these configuration files are nicely written, with a lot of nested 
> structure, while ansible variables are just flat (IMHO using nested 
> variables in Ansible is unfeasible either because it's hard to do defaults 
> and overrides, hard to do references between variables, etc).   
>
> Not only templates, I would also like to store binary files (zipfiles?) 
> that could be different per inventory. Is that possible? 
>
> Thanks a lot for answers,
> Krzysztof 
>
>

-- 
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/d4ffc5bb-f63b-48fb-acee-76a5238fc25b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to