How to use groups and/or labels in templates

Hello AWX-experts,

I have defined a huge list of hosts as an inventory. Now, I’d like to run some playbooks to a sub-group of them, i. e., the database hosts.
So, I’ve defined a group “databases” below the main group, and would like to use this in my template - but, I can only choose the complete inventory without any option to choose the group.
My next idea was to use labels, and attach a label “database” to all DB hosts or the subgroup - but that’s also not possible, labels can only be used for templates and inventories, if I’m right.
So I’m a bit confused, is there any way to achieve this? Or do I have to create a new inventory containing only the database hosts and run my job against this?

Thanks and best regards from Germany,

Harald

See the --limit option.

Walter

Hello Walter,

thanks for your answer. And yes, I’m using the --limit parameter on CLI and sometimes also in AWX to let a playbook run on only some hosts.
But, I’d suppose that it would be possible to choose the defined labels and/or groups in job templates using the UI, as I can do it for inventories etc. Do I really have to write them in the limit field, as I do on CLI?

Thanks and best regards from Germany,

Harald

Yes. I have Ansible Automation Platform. It has a limits field. We use that to “limit” which groups or hosts from the inventory are run against.

Walter