Unable to view the contents of file in ansible managed nodes

Lookups are executed on Ansible controller (as pointed out by @Vladimir Botka). If you just want to view the contents of a file on remote hosts, you can cat the file through ansible and debug the stdout_lines.

  - command: "cat /tmp/check/{{ inventory_hostname }}_Comparison"
    register: file_cat
    changed_when: false

  - debug:
      var: file_cat.stdout_lines

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top