# debug module does not escape double quotes

**URL:** <https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900>\
**Category:** Ansible Project\
**Created:** [March 5, 2018, 11:15am UTC](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900 "2018-03-05T11:15:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasha\_hajlaoui](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@rasha\_hajlaoui](https://forum.ansible.com/u/rasha_hajlaoui)\
**Post date:** [March 5, 2018, 11:15am UTC](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900/1 "2018-03-05T11:15:02Z")

</div>

Hello guys,

I’ve got a problem with ansible playbook. In fact, I use debug module to display a file content.

**the content of myfile is :**

**my playbook.yml is as follow:**

- name: Display file content  
shell: cat myfile  
register: file

- debug:  
msg: “{{file.stdout\_lines}}”

**playbook.yml output :**

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [serveur] =\> {  
“msg”: [  
" \<network ip=**\*\*"1.2.3.[0-255]**\*\*" /\>"  
]  
}

I don’t want ansible to add anti-slashes before double quotes. I just want it to display the file content as it is.

I’ll appreciate any help to fix this.

Thanks in advance.

Rasha

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [March 5, 2018, 7:49pm UTC](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900/2 "2018-03-05T19:49:42Z")

</div>

You may be able to do it with a different callback plugin but by default the output is displayed in JSON. JSON uses double quotes to quote keys and values so if the value has double quotes in them they need to be escaped with a backslash, e.g. the value of **‘abc “123”’** would become **"‘abc "123"’** in JSON

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 6, 2018, 7:40am UTC](https://forum.ansible.com/t/debug-module-does-not-escape-double-quotes/26900/3 "2018-03-06T07:40:10Z")

</div>

You are printing out stdout\_lines which is a list, you need to use {{ file.stdout }} instead.
