On Thursday, 23 November 2017 07.44.29 CET [email protected] wrote:
> Is there a way to concatenate variables?

Since you variable contains a list you can use the union filter
https://docs.ansible.com/ansible/latest/playbooks_filters.html

But this will remove duplicates or just use +.


> base:
>   - a
>   - b
>   - c
> 
> extend:
>   - x
>   - y
>   - z
> 
> Something like this?
> 
> together: 
>   - "{{ base }""
>   - extend
> 
> The above gives me
> 
>     "msg": "together [[u'a', u'b', u'c'], u'x', u'y', u'z']"

{{ base | union(extend) }}

{{ base + extend }}


-- 
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 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/3347878.AKTdgfqfBp%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to