Hi guys,
I would like to check the facts list in ansible, it should be located in /etc/ansible/facts.d directory. But ansible directory under /etc is not exist. Is there different location that facts are located?
Thanks.
Hi guys,
I would like to check the facts list in ansible, it should be located in /etc/ansible/facts.d directory. But ansible directory under /etc is not exist. Is there different location that facts are located?
Thanks.
Have you created this custom facts file ?
By default custom facts can be created and stored locally on each managed host. The /etc/ansible/facts.d directory does not exists by default. You will need to create this directory on each managed host , can use “file” module to do so. You can then copy the facts file into this directory for use by the playbook .
Thanks
Neha Pithadiya.
As @Neha points out /etc/ansible/facts.d is a way to generate facts,
does not list them.
Here is a way to generate a copy of the facts for a server (on the
machine that executes Ansible) :
`ansible -m gather_facts <hostname> --tree /var/tmp/ `
it will create a json file per host in '/var/tmp' with the output of
the module executed, in this case 'fact gathering'.