Need help to print all the messages as new lines

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

Try setting this in your ansible.cfg:

stdout_callback = yaml
bin_ansible_callbacks = True

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.

Any help in this issue will be highly appreciable.

Regards,
Jayan

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”
]
}