# Need guidance and how to use inventory with tower's satellite plugin AND local inventory

**URL:** <https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678>\
**Category:** Get Help\
**Tags:** aap, automation-platform, awx, satellite\
**Created:** [February 27, 2025, 6:06pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678 "2025-02-27T18:06:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brett](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/brett/32/7755_2.png) [@brett](https://forum.ansible.com/u/brett)\
**Post date:** [February 27, 2025, 6:06pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678/1 "2025-02-27T18:06:32Z")

</div>

Hello! I am struggling with how I can use both the satellite plugin inventory as well as the inventory from a project in Ansible Automation Platform.  
We are using ansible 2.9 and Ansible Automation Platform Controller 4.4.5.  
However i’m struggling to understand how to combine different inventory sources in the best way.

We have a specific playbook to manage some files across all hosts, what i’d like to happen would be to use the full list of files from the satellite inventory and combine them with an external source of group\_vars and host\_vars in order to get the full list of hosts from one constantly updating source and combine these with project specific groups and host vars in order to customize our variables.

What I expected to happen was to just simply define an inventory folder in the project containing the playbook, however this doesn’t seem to work, neither does just simply defining the host\_vars folder. I suspect there may be something else required here, but i’m also unsure if this is the best way to do what I accomplish.  
Can someone advise for the best practice / what i’m doing wrong here in order to accomplish what I want?  
Thank you!

---

<div class="post-metadata">

**Author:** ![brett](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/brett/32/7755_2.png) [@brett](https://forum.ansible.com/u/brett)\
**Post date:** [February 27, 2025, 7:05pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678/2 "2025-02-27T19:05:34Z")

</div>

ok, so I figured out what I was doing wrong - apparently `host_vars` and `group_vars` are not `.yml` files 😮‍💨  
however what i’ve still not clear on is group assignment when pulling from the inventory. If I have thousands of hosts coming from the inventory in satellite - how do I assign them either statically or dynamically to specific groups without making all of these changes upstream from the inventory source.

---

<div class="post-metadata">

**Author:** ![brett](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/brett/32/7755_2.png) [@brett](https://forum.ansible.com/u/brett)\
**Post date:** [February 27, 2025, 10:08pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678/3 "2025-02-27T22:08:06Z")

</div>

OK - sorry, continuing to answer my own question, it seems likes constructed inventories are the way to go. However it’s hard to get the full list of child groups, for instance, if you had site with 12 possible combinations, then env with another 8, and then say team with a few hundred, it’s not clear to me how you’d define group vars specifically for two different sets of these. ie. `chicago`, `qa`, `ops` may have different values than `new york`, `prod`, `ops` or even `chicago`, `prod` `ops`.

Would I make a group for each possible combination?

---

<div class="post-metadata">

**Author:** ![brett](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/brett/32/7755_2.png) [@brett](https://forum.ansible.com/u/brett)\
**Post date:** [February 28, 2025, 6:27pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678/4 "2025-02-28T18:27:48Z")

</div>

I wasn’t able to figure out how to get this worked solely with constructed inventory, but by using the group\_by builtin module I was able to define groups / memberships with jinja2 at runtime.  
So I think I can close this issue now. The secret sauce was:

1. Using keyed\_groups in a constructed inventory to define the “basic” groups.
2. Creating group\_by with jinja to define the combination of each group and defining the hierarchy
3. Using the host\_vars / group\_vars (and putting the correct file extension)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 30, 2025, 6:28pm UTC](https://forum.ansible.com/t/need-guidance-and-how-to-use-inventory-with-towers-satellite-plugin-and-local-inventory/40678/5 "2025-03-30T18:28:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
