Ansible 1.3 - Read facts from files.

Hi there,

On ansible webiste for modules there is information that ‘setup’ module can use fact_path paramters which allow read facts from file.
I searched ansible-examples and don’t see any example for this so far. So could you give me small example how this is working, please?

  1. Whether this happening automatically during gathering facts - or what I need is just fact files in json or ini file located in path? If yes how pass path to ‘setup’ module?
  2. Or I can setup task ‘setup’ and gather facts (again) and with fact_path parameter?
  3. Is there any example somewhere (webiste / git) where I can see how facts files should look like in json or ini format. Or use format from setup module and using my own varaibles?

I think this is really useful option - but so far I have no idea how to use it.

Hope that is somebody who already done this and will share a bit of light others ansible users :slight_smile:

Best regards,
Marcin Praczko

This setting is for the “local facts” feature, as described here:

http://ansibleworks.com/docs/playbooks_variables.html#local-facts-facts-d