Ansible dynamic inventory
-
I'm exploring using xo-lib to build a dynamic inventory for ansible.
Looks like it should be pretty simple, to get a list of hosts, with ip's if they agents installed and leverage tags and/or custom fields for host varsBut whats missing, is a way to create group vars cleanly. I can group servers using tags, like
ansible_group:web
but i can't see a way to create vars for that group without repeating them on every host.If anyone has tackled this issue i'd love to hear how you approached it.
And i guess maybe theres a Feature Request here - Create VM Groups, where Groups can have tags attached. If we had that, then an Ansible Inventory Plugin would be a simple bolt onEDIT -
Just to add, i've seen this https://github.com/vtsingaras/xenorchestra_inventory/blob/master/xenorchestra.py
and i'm aware there was a question back in July about ansible inventory that got no replies so maybe theres not a lot of love for dynamic inv here Or maybe people are using other inv management tools... love to know what -
We sponsored someone to work on Terraform and Packer. But every contribution is welcome, on Ansible too