Ansible Inventory Scripts

Ansible Inventory Scripts

# TIL

It appears that you are required to use a .ini file with inventory scripts in Ansible. If you try and use static variables in the script, it will appear to work when running the raw Python or whatever you’re using to gather the data. It will then fail with seemingly nondescript errors when you try and actually use the inventory. 

So, in short make sure you use .ini files, and don’t try and hard code vars in your script. 

Example import script: https://github.com/bile0026/ansible_prtg_inventory_import

Example of output:

Plain Text

	
		     

Leave a Reply

Your email address will not be published. Required fields are marked *