I want to see if there is any changes in the file one present in local and other on the remote host. If there is any difference, it should be visible in screen what should
This sounds like a task you can do with the debug module. Use diff to get the diff of both files. Register the output and use debug for display:
- name: Generate diff command: diff /tmp/abc.txt /tmp/def.txt register: diff_result - name: Show diff result debug: var: diff_result