Filter hosts matching groups

Hi all,

I have a custom CMDB and I've created a script for dynamic inventory. On that script I have grouped hosts using several ways, just like VMware dynamic inventory script.

My question is, how can I match using more then one group? Something like, I want to deploy to all Linux, that are in the prd group but only the ones that are also in the data center X.
Is this possible?

Thanks,
Bruno

It shouldn't be a problem check at patterns
https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html

Hi,

Thanks Kai, I will give it a try.

Bruno

Try this in your playbook

hosts: linux:&prod:&datacenter_x