From aa9255b16ee5b91111011bcf4452e22caffd2ae8 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Thu, 9 Jan 2025 18:08:40 -0800 Subject: [PATCH] add ansible_facts dump Useful for seeing what Ansible knows about the system. $ ansible-playbook -i localhost facts.yml $ less /tmp/ansible_facts.json --- facts.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 facts.yml diff --git a/facts.yml b/facts.yml new file mode 100644 index 0000000..89354c5 --- /dev/null +++ b/facts.yml @@ -0,0 +1,10 @@ +--- +- hosts: localhost + tasks: + - name: Print ansible_facts + debug: + var: ansible_facts + - name: Save ansible_facts to /tmp/ansible_facts.json + copy: + content: "{{ ansible_facts|to_nice_json }}" + dest: /tmp/ansible_facts.json