# Need help to print all the messages as new lines

**URL:** <https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240>\
**Category:** Ansible Project\
**Created:** [May 27, 2021, 2:54pm UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240 "2021-05-27T14:54:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayan\_Anirudhan](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jayan\_Anirudhan](https://forum.ansible.com/u/Jayan_Anirudhan)\
**Post date:** [May 27, 2021, 2:54pm UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240/1 "2021-05-27T14:54:41Z")

</div>

Hi Team,

I have created a playbook to gather information from a Redhat KVM server. The issue I am facing is that I am getting the entire message in a single line. Can someone suggest a solution to print the message content as individual lines instead of a single line.

play book

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [May 27, 2021, 3:02pm UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240/2 "2021-05-27T15:02:09Z")

</div>

Try setting this in your ansible.cfg:

stdout\_callback = yaml  
bin\_ansible\_callbacks = True

---

<div class="post-metadata">

**Author:** ![Jayan\_Anirudhan](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jayan\_Anirudhan](https://forum.ansible.com/u/Jayan_Anirudhan)\
**Post date:** [May 27, 2021, 4:11pm UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240/3 "2021-05-27T16:11:08Z")

</div>

Hi Dick,

Thanks a lot for the reply. I added the entry to the ansible.cfg file and found the issue persists. Message display is still the same as mentioned below.

---

<div class="post-metadata">

**Author:** ![Jayan\_Anirudhan](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jayan\_Anirudhan](https://forum.ansible.com/u/Jayan_Anirudhan)\
**Post date:** [May 28, 2021, 8:46am UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240/4 "2021-05-28T08:46:23Z")

</div>

Any help in this issue will be highly appreciable.

Regards,  
Jayan

---

<div class="post-metadata">

**Author:** ![Clint\_Denham](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Clint\_Denham](https://forum.ansible.com/u/Clint_Denham)\
**Post date:** [May 28, 2021, 9:50pm UTC](https://forum.ansible.com/t/need-help-to-print-all-the-messages-as-new-lines/35240/5 "2021-05-28T21:50:32Z")

</div>

Is this an option (using a list of messages), or are you looking for something different?

- name: Print Upgrade Information  
debug:  
msg:
- “Currently installed version: {{ current\_version }} booting from {{ current\_boot\_loc[:-2] }}”
- “New Image {{ new\_v13\_version }} + {{ new\_v13\_build}} will be uploaded from {{ new\_image\_dir }}”
- “It will be installed to boot location ‘{{ dest\_boot\_loc }}’”

In the playbook that I use, it generates this

ok: [device-name] =\> {  
“msg”: [  
“Currently installed version: 12.1.2 booting from HD1.1”,  
“New Image 13.1.3 + 0.0.5’ will be uploaded from ./UPGRADES/ISO’”,  
“It will be installed to boot location HD1.3”  
]  
}
