Hello,
My problem is simple. I created a script that return a json with server network informations when run: script.py --host .
How can I use this facts ? I test with setup module but it seems to need a script that return in first time all servers with script.py --list and next run script.py --host .
Any idea ?
Some useful info if you haven’t read both of them already:
Dynamic inventory: http://docs.ansible.com/intro_dynamic_inventory.html
Developing dynamic inventory: http://docs.ansible.com/developing_inventory.html
Basically these are only useful when used as inventory, the ‘setup’ module in Ansible provides variables about the host after talking to them, the inventroy script provides data before talking to them. If you’re asking how to use that script, you chmod +x it and use it as the name of your inventory file.
If you’re asking how to use variables from that script, variables from anywhere in ansible can be used as arguments to modules like {{ variable_name }}, so those work just like facts from the setup module.
Let us know more specifics about what you’re looking to do and we can perhaps provide other pointers.
Thanks!