That's because they are escaped newlines, versus real newlines, I'm
suspecting.



On Mon, Sep 15, 2014 at 6:51 PM, AJ Daws <[email protected]> wrote:

> Unfortunately that still shows escaped newline characters so isn't any
> more readable.  For example:
>
> TASK: [ec2-launcher-v2 | debug var=cloudinit_user_data]
> ***********************
> ok: [localhost] => {
>     "cloudinit_user_data": "#cloud-config\nusers:\n - name: core\n
> ssh-authorized-keys:\n     - ssh-rsa AAAA..."
>
>
> On Monday, 15 September 2014 14:32:43 UTC-7, James Cammarata wrote:
>>
>> Hi AJ,
>>
>> Using "- debug: var=cloudinit_user_data" will show you the pretty-printed
>> version of the var, without any escaped values, though you won't be able to
>> control the indentation of that data.
>>
>> Thanks!
>>
>> On Fri, Sep 12, 2014 at 7:55 PM, AJ Daws <[email protected]> wrote:
>>
>>> I have a large, multi-line string that I would like to output in a role.
>>>  Currently I'm using the debug module like this:
>>>
>>> - name: Cloud-init user_data
>>>   debug:
>>>     msg: "{{ cloudinit_user_data|indent(6) }}"
>>>
>>> However this generates JSON output which is quite hard to read as
>>> newlines are represented as "\n" rather than an actual new line.  Is there
>>> a simple way to simply output a string as-is?
>>>
>>>  --
>>> 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/ea53aba8-c5c4-449b-875d-
>>> 8440606426bc%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/ea53aba8-c5c4-449b-875d-8440606426bc%40googlegroups.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/6aad5e54-d5ae-46ac-a08e-153591f35b95%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/6aad5e54-d5ae-46ac-a08e-153591f35b95%40googlegroups.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/CA%2BnsWgwUxwm30S7WNfPFftta-_UZu3iJCDKhKMekrjtfRWrYRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to