Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created January 13, 2016 22:51
Show Gist options
  • Save dmsimard/1f3b40c84879da7ade3b to your computer and use it in GitHub Desktop.
Save dmsimard/1f3b40c84879da7ade3b to your computer and use it in GitHub Desktop.
- name: Capture facts for output to file
setup:
register: ansible_facts
- name: Output facts to file
copy:
content: "{{ ansible_facts | to_nice_json }}"
dest: "./before.txt"
- set_fact:
one_fact: something
- name: Capture facts for output to file
setup:
register: ansible_facts
- name: Output facts to file
copy:
content: "{{ ansible_facts | to_nice_json }}"
dest: "./after.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment