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

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!

ok, so I figured out what I was doing wrong - apparently host_vars and group_vars are not .yml files :face_exhaling:
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.

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?

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)