You could pick up a different version of a file say for each environment

- name: copy environment-specific config
  copy: 
    src: "configuration.{{environment}}.conf"
    dest: /etc/someconf.conf

I'd argue that if there are lots of things that are different between test 
and prod then you are more likely to hit problems when your applications 
finally reach prod, so might be worth some pain to try and make some things 
(that aren't directly related to scaling) the same in both test and 
production.

Also defaults in ansible are pretty easy.  As well as defining defaults in 
your roles, you can do in-line defaults in your playbooks

- name: wait for startup
  pause:
     seconds: "{{ some_app_startup_pause_seconds | default(60 }}"

Hope this helps,

Jon
On Monday, May 9, 2016 at 10:13:31 AM UTC+1, Krzysztof Zarzycki wrote:
>
> 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/10b75b4b-9c2b-4617-afb2-80e2cbc50740%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to