# How to add a newline inside a string ?

**URL:** <https://forum.ansible.com/t/how-to-add-a-newline-inside-a-string/15998>\
**Category:** Ansible Project\
**Created:** [August 21, 2014, 9:22am UTC](https://forum.ansible.com/t/how-to-add-a-newline-inside-a-string/15998 "2014-08-21T09:22:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Barroso](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Javier\_Barroso](https://forum.ansible.com/u/Javier_Barroso)\
**Post date:** [August 21, 2014, 9:22am UTC](https://forum.ansible.com/t/how-to-add-a-newline-inside-a-string/15998/1 "2014-08-21T09:22:05Z")

</div>

Hello,

How can I add a new line to a parameter, for example:

fail: msg=“Error:\n {myoutput.stdout}”  
…

\n is not working there and not clue in doc / internet search

Thank you for ansible !

---

<div class="post-metadata">

**Author:** ![Javier\_Barroso](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Javier\_Barroso](https://forum.ansible.com/u/Javier_Barroso)\
**Post date:** [August 23, 2014, 8:13am UTC](https://forum.ansible.com/t/how-to-add-a-newline-inside-a-string/15998/2 "2014-08-23T08:13:05Z")

</div>

Hello,

Just after publish this post, I discover that I can use a variable with “\n” as value and then use {{variable}}, and it works

Thanks !
