To make my request a bit more clear:

I'd like to add the entries of level1keyB to the list 'path' in the 
specific 'level1keyA' entry with the 'hostname' "bar".

Hope that helps a bit.

Thank you.


Am Mittwoch, 30. März 2016 15:46:22 UTC+2 schrieb Jard Leex:
>
> Hello together,
>
> i'd like to combine two lists directly in a vars section/file. 
> I've tried the combine filter but as i understood it, it is for dicts and 
> not lists.
> Also the union filter did not worked for me as i tried it
> I assume that i did something wrong.
>
> Can someone here make the example below fly?
>
>
>
> ---
> - name: combine lists
>   hosts: localhost
>   vars:
>     - level1keyA:
>         - hostname: foo
>           state: present
>           path:
>             - left
>         - hostname: bar
>           state: present
>           addonpath:
>             - righthere
>           path:
>             - "{{ WHAT TO WRITE HERE? }}"
>     - level1keyB:
>       - right
>       - middle
>       - top
>   tasks:
>     - name: result of level1keyA
>       debug:
>         msg: "{{ level1keyA }}"
>
>     - name: result of level1keyB
>       debug:
>         msg: "{{ level1keyB }}"
>
>
> It would be great if the task could be solved within the vars itself 
> without editing the playbook using them.
>
>
> Thank you very much!
>
> Best
> Jard
>

-- 
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/70f39942-ff68-4372-86b5-efeb79fc6789%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to