Ansible Dynamic Inventory
I've registered all of my hosts into PatchMon, and assigned them into groups.
It'd be amazing if I could point Ansible at a dynamic inventory plugin that queries patchmon for a list of hosts (and their groups)
https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html
Is this something you'd be willing to support? I'm happy contributing to this feature/new repo if accepted?
4 Comments
I think this is in large part there already. There is an endpoint , /api/v1/hosts/info which returns host info. Probably need to add in host group info which this endpoint currently does not return. I'm going to take a stab at writing the plugin.
I'm going to further research into this.
If anyone else has view on this feature request then do put them forth :)
This is an interesting idea! I would probably use this. Perhaps this could be handled outside of PatchMon though: if there is an API to retrieve all hosts and their groups from PatchMon, one could create a simple script to turn this into the correct syntax for an Ansible inventory

https://galaxy.ansible.com/ui/repo/published/patchmon/dynamic_inventory/
tested against v1.3.4