# Failure in Inventory Source: Template additional groups and hostvars at runtime Option for inventory source

**URL:** <https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [January 9, 2025, 1:03am UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518 "2025-01-09T01:03:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnfrancis](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cnfrancis/32/2615_2.png) [@cnfrancis](https://forum.ansible.com/u/cnfrancis)\
**Post date:** [January 9, 2025, 1:03am UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/1 "2025-01-09T01:03:30Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/7/7c61df516bd2fea1f8f0ef1675681cc6ee2f9322.png)  
This is the call it made `/api/v2/inventory_sources/`  
Running AWX 24.6.0

If that [option is no longer supported](https://github.com/ansible/awx/issues/15001) 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.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 9, 2025, 3:19pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/2 "2025-01-09T15:19:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cnfrancis](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cnfrancis/32/2615_2.png) [@cnfrancis](https://forum.ansible.com/u/cnfrancis)\
**Post date:** [January 9, 2025, 8:39pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/3 "2025-01-09T20:39:13Z")

</div>

im trying to run a job template without an inventory that is persisted in awx’s database, how could I do so ? how would you do it?

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 9, 2025, 8:57pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/4 "2025-01-09T20:57:55Z")

</div>

I don’t remember the exact name of the option, but i believe you just define the job with a ‘job source inventory’.

---

<div class="post-metadata">

**Author:** ![cnfrancis](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cnfrancis/32/2615_2.png) [@cnfrancis](https://forum.ansible.com/u/cnfrancis)\
**Post date:** [January 9, 2025, 9:28pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/5 "2025-01-09T21:28:58Z")

</div>

hmmm i’m not sure what you’re referring to, perhaps i could just pass a static file that is empty and go from there

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 9, 2025, 9:31pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/6 "2025-01-09T21:31:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![matteoclc](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matteoclc/32/7020_2.png) [@matteoclc](https://forum.ansible.com/u/matteoclc)\
**Post date:** [January 9, 2025, 9:53pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/7 "2025-01-09T21:53:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cnfrancis](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cnfrancis/32/2615_2.png) [@cnfrancis](https://forum.ansible.com/u/cnfrancis)\
**Post date:** [January 9, 2025, 9:59pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/8 "2025-01-09T21:59:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [January 9, 2025, 10:15pm UTC](https://forum.ansible.com/t/failure-in-inventory-source-template-additional-groups-and-hostvars-at-runtime-option-for-inventory-source/39518/9 "2025-01-09T22:15:23Z")

</div>

see scm inventory, you can define an inventory source provided by the same repository as the job itself.
