Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Created November 25, 2022 12:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbietunnie/67262aec81f64d523af9a87808a8704e to your computer and use it in GitHub Desktop.
Save barbietunnie/67262aec81f64d523af9a87808a8704e to your computer and use it in GitHub Desktop.
How to dump file contents to console with Ansible

How to dump file contents to console with Ansible

-  name: Display content of resolv.conf
  hosts: localhost
  tasks:
    - name: Display resolv.conf contents
      command: cat resolv.conf chdir=/etc
      register: command_output

    - name: Print to console
      debug:
        msg: "{{command_output.stdout}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment