On 2 July 2015 at 17:05, Charly Koza <[email protected]> wrote:

> Hello !
>
> I somehow need to
> - assign applications to groups of hosts
> - have a host in several groups in the platform
> - get the list of deployed applications in the platform
> - be able to get the list of hosts with the application.
>
> I tried like that :
>
> I'm trying to have a variable (dokku_apps) defined for multiple groups.
> depending on the target server (testing, prod, and so on), a single host
> can use many groups or only one.
>
> the idea is that a group should configure some dokku apps. so if a host is
> in many groups it should configure dokku apps specific to each of its group
>
> my problem is that when a host is in many groups, the dokku_apps
> (configured in group_vars) is only from a single group (the latest i think)
> and is not merged (as expected from documentation)
>
> I'm also using this list (dokku_apps) to configure varnish.
>
> How can i achieve that ?
>

​Given that variables are merged according to group priorities, and there
is no some default way to add-up some lists, this is hard to achive
cleanly.​

A workaround might be to put this data in dictionaries, and enable dict
merging in ansible.cfg


TBH, I never found a clean wat to do this kind of construct. It should be
something we want to enable when revamping inventory things.

-- 
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/CAEhzMJDUfj40_pimXVQJ66vhR93mc4%3D3eHsMS8OXHwE0_cowDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to