Thanks matt. to_yaml worked great.
The underscores...
I use hash_behavior = merge and i've found that if i define parts of the
dict across different files then a statement like
dict1: {{dict1}}
will fail with a "recursive definition detected" message. I was being
defensive. In this case, it worked fine removing the underscores from the
vars.
k
On Wednesday, September 24, 2014 2:00:24 PM UTC-5, Michael DeHaan wrote:
>
> Are those underscores before the names of the keys typos?
>
>
>
> On Wed, Sep 24, 2014 at 2:58 PM, Matt Martz <[email protected] <javascript:>
> > wrote:
>
>> An example being:
>>
>> dict1: {{dict1|to_yaml}}
>>
>> Which produces:
>>
>> dict1: {_int1: '5', _str1: four}
>>
>> On Wed, Sep 24, 2014 at 1:54 PM, Matt Martz <[email protected]
>> <javascript:>> wrote:
>>
>>> You should probably use either the to_nice_yaml or to_yaml filters
>>>
>>> On Wed, Sep 24, 2014 at 1:48 PM, kesten broughton <[email protected]
>>> <javascript:>> wrote:
>>>
>>>>
>>>> The goal is to define a dictionary like
>>>>
>>>> dict1:
>>>> int1: 5
>>>> str1: "four"
>>>>
>>>> and be able to template output the dictionary as a whole (not leaf by
>>>> leaf) such that the output looks like
>>>>
>>>> dict1: {"int1": 5, "srt1": "four"}
>>>>
>>>> The actual output prefixes the values on the RHS of the : with a u so it
>>>> looks like
>>>> dict1: {"int1": u"5", "srt1": u"four"}
>>>>
>>>>
>>>> dict1: {"int1": u"5", "srt1": u"four"}
>>>>
>>>> Please see the gist for details.
>>>> https://gist.github.com/darKoram/3f2fbcc9b3a003546f3c
>>>>
>>>>
>>>> --
>>>> 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] <javascript:>.
>>>> To post to this group, send email to [email protected]
>>>> <javascript:>.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/CAK5UeTtD2jejt8%3DAqFsG2S-YCX3dmDgCw533F5LibW6OKMVRTQ%40mail.gmail.com
>>>>
>>>> <https://groups.google.com/d/msgid/ansible-project/CAK5UeTtD2jejt8%3DAqFsG2S-YCX3dmDgCw533F5LibW6OKMVRTQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Martz
>>> @sivel
>>> sivel.net
>>>
>>
>>
>>
>> --
>> Matt Martz
>> @sivel
>> sivel.net
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAD8N0v9HWuR%2BNwBeUzOmgLxCF_%2Bx6NHp_mbGxooG9gyfD3YJZA%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v9HWuR%2BNwBeUzOmgLxCF_%2Bx6NHp_mbGxooG9gyfD3YJZA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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/4bd1659a-1bc8-4949-bb42-dfc3cdaaa96b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.