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/e4fe107c-6648-4572-d148-7fc89e725b39%40olstad.com.