print the register output with proper format on the screen

Hi everyone ,

I am trying to print 2 files in my ansible server itself, which are already copied from other servers , which means the filenames have hostnames and date within it.

  • name: compare the output files
    local_action: command /usr/bin/sdiff “{{ logs_dir }}”/{{ inventory_hostname }}-Precheck-{{ ansible_date_time.date }}.txt “{{ logs_dir }}”/{{ inventory_hostname }}-Postcheck-{{ansible_date_time.date }}.txt
    register: result

  • debug:
    var: result.output

I am able to print the output I expected …but it collapses than expected.
Is there a way to Print them as like as in a linux bash " # diff file1 file2 "

redirecting the output to a file and printing is also helping