Apologies for the late reply.

What I'm looking for is more something for use inside a role, and also 
additive.
So, if I already have a list, to be able to specificy a "when" condition 
and if the condition is met, add something to the list.


On Friday, August 30, 2019 at 12:27:08 AM UTC+2, Kai Stian Olstad wrote:
>
> On 29.08.2019 22:19, Koen De Groote wrote: 
> > The question is: how do you do it? I'm looking for an example. 
> > 
> > Nothing I've found so far in the documentation says outright "this is 
> how 
> > it's done". 
> > 
> > I'm uncertain what kind of variable I need to produce, in what way, so 
> that 
> > it is the correct one for this field to accept it. 
> > 
> > This may be obvious to a lot of people, but not to me. 
>
> You have this 
>
>   volumes: 
>   - '{{ dir1 }}:{{ dir1 }}' 
>   - '/tmp:/tmp' 
>
> The dashes indicates it's a list, and pretty sure if you check the 
> documentation it says that volumes takes a list. 
> So create a variable with a list in it and provide that variable to 
> volumes. 
>
> Define a variable 
>   vars: 
>     myvar: 
>     - '{{ dir1 }}:{{ dir1 }}' 
>     - '/tmp:/tmp' 
>
> and then use it 
>
>   volumes: '{{ myvar }}' 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a6d0601a-3c11-448f-93f9-706051a65169%40googlegroups.com.

Reply via email to