Python script to retrieve data from Zabbix API and convert it to Ansible inventory format
- Python3
- pyzabbix
- Download zabbix_inventory.py on Ansible control node
- Install pyzabbix
pip3 install pyzabbix
- Modify file
- Change permissions to allow execute
chmod +x zabbix_inventory.py
- Verify
ansible-inventory -i zabbix_inventory.py --list
The script has been tested on Zabbix 5.0