On Tue, 18 Apr 2023 at 00:22, Michael DiDomenico <[email protected]>
wrote:

> i want to do this, but i'm not getting exactly what i want
>
> lista:
> - { one: 'str1', two: 'str2' }
>
> listb:
> - "{{ lookup('vars','lista') }}"
> - { one: 'str1', two: 'str2' }
>
> the output i want is
>
> listb:
> { one: 'str1', two: 'str2' },
> { one: 'str1', two: 'str2' }
>
> but what i get is
>
> listb:
> [ { one: 'str1', two: 'str2' } ],
> { one: 'str1', two: 'str2' }
>
> is there a way to merge the two lists?
>

If lista will only ever contain a single item, then listb could be just

listb:
- "{{ lista[0] }}"
- { one: 'str1', two: 'str2' }

-- 
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/CAF8BbLY01xvU7Z-GU8yvNww9xF95JOw5Mst0UYuVgninwzXsww%40mail.gmail.com.

Reply via email to