hello!
I am exploring different ways to manage the inventory, namely I am interested in exploring how can I completely rely on a vars/group plugin which at runtime fetches the inventory from a url i give it.
It seems the only option is for me to use the source “Template additional groups and hostvars at runtime”, however I am getting this error.
This is the call it made /api/v2/inventory_sources/
Running AWX 24.6.0
If that option is no longer supported anyone has an idea how can I rely on an inventory that is purely determined at runtime and not persisted? I am trying to minimize the sync necessary.
i believe that ticket is not about support but about naming/clarification of the option, this is basically the recent ‘constructed templated inventory’ added to awx.
how are you actually trying to populate inventory? it can only done either an inventory source (which uses an inventory plugin) or in play via add_hosts/group_by actions, what you describe above does not seem to either.
I believe what you mean it’s not the intended way for awx to work. You define a inventory with its inventory source(s), then you configure a schedule for automatically update the inventory (iirc there is the option to trigger the inventory update just before a job run) and finally you configure the job template referencing that inventory.
If this really doesn’t fit your need you’d be better to find an alternative solution for running your playbooks because you might encounter issues by going too much out of “the way”.
Having said that, you could also leverage the add_host module inside a playbook to dynamically define your “in memory” inventory (taken from an API call or whatever you may need) for using in a subsequent play inside the same playbook. At that point your inventory in AWX will just be “localhost” and that’s it.
yeah you’re right I was doubting this.
because the issue becomes when the fat json grow too much and even though it takes you a second to generate it, awx need to process the json under the hood and update its db. there are different ways to address this, i was curious to see what the community thinks about not relying completely on AWX’s persistence layer for the inventory and at runtime instead, make AWX do for e.g an API call to an external service to get inventory cut in the way the playbook asks.