I'm using ansible 2.9.3 and I'm having trouble trying to display the content of a file from the target machine, this is my playbook :
- name: Display content of resolv.conf hosts: jenkins tasks: - name: Display resolv.conf contents command: cat resolv.conf chdir=/etc register: command_output - name: Print to console debug: msg = "{{command_output.stdout}}" And my task Print to console returns:
TASK [Print to console] ************************************************************************************************************************************************************************************ ok: [jenkins] => { "msg": "Hello world!" } I wanted to have the content of the file to stdout, what am I missing ? Thx