Skip to content

Instantly share code, notes, and snippets.

@prandelicious
Last active March 22, 2018 09:38
Show Gist options
  • Save prandelicious/cc150825b6c4dec6c5c2a54941c1c066 to your computer and use it in GitHub Desktop.
Save prandelicious/cc150825b6c4dec6c5c2a54941c1c066 to your computer and use it in GitHub Desktop.
[Ansible] Ways to write output of a register variable to a local file
- name: Write to local disk
local_action: "copy content='{{ result.stdout_lines }}' dest='../files/list_cronjobs/list_cronjobs.txt'"
- name: Write to local disk
lineinfile: dest=../files/list_cronjobs/list_cronjobs.txt create=yes line="{{ result.stdout_lines }}"
delegate_to: 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment