Filter by Hosts by Host Groups in Satellite

Posted on

At a playbook level, for Anisble, does anyone know how to filter hosts based on the hostgroup assigned in Satellte? Best practices state we should create parent hostgroup and create children hostgroups within the parent hostgroup. I have our set up based on the enviornment; PROD, QA, DEV. However, when I want to develop a playbook, that will ru>n based on the Satellite host group, I am unable to do so.

From CLI, I am using the Red Hat Satellite collection, which pulls a dynamic inventory from Satellite. I can filter from here, however, when I run this from Satellite, it does not work the same.

I have attached an image of the hostgroup from my Ansible Dev environment and image of the hostgroup name in satellite.

I believe there is a way to do this, but I am not sure how. If anyone has a working example, please share or educate me.