On Wed, 5 Jan 2022 10:09:45 -0600
Matt Martz <[email protected]> wrote:

> > For example, given "val1: foo"
> >
> >     - set_fact:
> >         _var1: |
> >           {"key1": "{{ val1 }}"}
> >         _var2: |
> >           {"key1": "foo"}
> >     - debug:
> >         var: _var1|type_debug
> >     - debug:
> >         var: _var2|type_debug
> >
> > gives
> >
> >   _var1|type_debug: dict
> >   _var2|type_debug: AnsibleUnicode
> >
> > *_var1* expands to a dictionary but *_var2* expands to a string. Is it
> > a feature or a bug?

>   b. Because jinja2 has historically only had the ability to template
> strings, we do some magic to try and convert strings that look like python
> data structures to python data structures

Why don't you try this magic consistently both on jinja2 and
non-jinja2 expressions?

Thank you,

--
Vladimir Botka

-- 
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/20220105172434.0a93317b%40gmail.com.

Attachment: pgpFbWcx3XRCF.pgp
Description: OpenPGP digital signature

Reply via email to