I am working on a playbook (for use in AWX) to handle some backend processing for one of our web apps.
One of the extra variables passed to the playbook via a REST call to AWX is used to pass the hosts
to the playbook
hosts: {{target}}
target can be a single server or a list of servers.
Question: how can I use patterns to skip a host if it is not a member of an inventory group
e.g if I want the playbook to skip a server if it's in the staging group in inventory
I have tried the following:
hosts: "{{target}}:!staging"
this only works if only one server is sent as target var, however it fails if called with a list.