I had a similar goal, and I was able to come up with something that seemed to work. It depends on the observation of Marcin, but I will talk about some details. If you split the stocks between prod and stg, you can do the following ...
In your prod inventory, define the groups:
[prod_website] #hosts go here... [website:children] prod_website
Then, in your stg inventory, define similar groups:
[stg_website] #hosts go here... [website:children] stg_website
Then in the group_vars group you will create shafts for the intersection of the groups under prod_website and stg_website. When you call ansible and specify which inventory to use, it will pull the group intersection keys you need, but in your books you can still refer to a common group of websites, which is present in both prod and stg.
source share