add ansible_facts dump

Useful for seeing what Ansible knows about the system.

    $ ansible-playbook -i localhost facts.yml
    $ less /tmp/ansible_facts.json
This commit is contained in:
Pig Monkey 2025-01-09 18:08:40 -08:00
parent 79e261bd84
commit aa9255b16e

10
facts.yml Normal file
View file

@ -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