How to use groups and/or labels in templates

182 views
Skip to first unread message

Harald Husemann

unread,
Sep 11, 2023, 5:53:47 AM9/11/23
to AWX Project
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

Rowe, Walter P. (Fed)

unread,
Sep 11, 2023, 6:55:16 AM9/11/23
to awx-p...@googlegroups.com
See the --limit option.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/20ddd5ba-0a1c-468b-89c2-004bf4e6dcean%40googlegroups.com.

Harald Husemann

unread,
Sep 11, 2023, 7:28:21 AM9/11/23
to AWX Project
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 

Rowe, Walter P. (Fed)

unread,
Sep 11, 2023, 7:59:42 AM9/11/23
to awx-p...@googlegroups.com
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
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123
Reply all
Reply to author
Forward
0 new messages