# Scheduling a job template based on host tags

**URL:** <https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216>\
**Category:** AWX Project\
**Tags:** windows, awx\
**Created:** [June 19, 2020, 8:19am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216 "2020-06-19T08:19:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [June 19, 2020, 8:19am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/1 "2020-06-19T08:19:52Z")

</div>

Hello Everyone,

I have a job template for patching windows servers (named windowsUpdate) against a list of hosts in inventory file. I want to schedule the patching activity using AWX based on tags assigned to hosts.

for eg: Suppose i have a list of server : Server1,Server2,Server3,Server4,Server5,Server6,Server7,Server8,Server9,Server10 .

And I want to patch Server1,Server2,Server3 on every 3rd Wednesday every month and Server4, Server5 on 4th Wednesday every month. Similarly Server6 ,Server7,

Server8, Server9, Server10 on every Tuesday.

So, if i am scheduling the template windowsUpdate it will start patching every host in the inventory file. But Based on the above I want some of them to patch on every 3rd wednesday and so on…

So, Is there any way to segregate hosts such that I can schedule the playbook and it will do the update on required days and just on required hosts.

As of now i don’t see any option to do this in AWX console or don’t know.

Please If anyone have any suggestions .Please help me out on this.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 19, 2020, 8:22am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/2 "2020-06-19T08:22:04Z")

</div>

You can create a job template based on the same playbook with different limits. Then assign it to the schedule

---

<div class="post-metadata">

**Author:** ![Mani\_Mohan](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Mani\_Mohan](https://forum.ansible.com/u/Mani_Mohan)\
**Post date:** [June 19, 2020, 9:13am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/3 "2020-06-19T09:13:27Z")

</div>

Adding to below, try segregating your inventory to smart groups, based on days may be . . Which can be mentioned in limit of the Schedule.

[https://docs.ansible.com/ansible/latest/user\_guide/intro\_patterns.html](https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html)

Or you can Use dynamic inventory using add\_host module, parametrise the hosts of playbook, pass different Extra\_vars values for different Schedules.

Thanks and Regards  
Mani Mohan

---

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [June 22, 2020, 4:46am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/4 "2020-06-22T04:46:22Z")

</div>

Hello Mani,

Thanks for your reply. Okay sure I will check on this method to schedule the job.

Thanks again.

---

<div class="post-metadata">

**Author:** ![harsh\_chawda](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@harsh\_chawda](https://forum.ansible.com/u/harsh_chawda)\
**Post date:** [June 22, 2020, 4:52am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/5 "2020-06-22T04:52:31Z")

</div>

Hello Wei-Yen,

Thanks for your reply. Surely I will check on it.

But I have one question is assigning a host with some tag and then scheduling based on host tags it is still not possible in AWX?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 22, 2020, 5:43am UTC](https://forum.ansible.com/t/scheduling-a-job-template-based-on-host-tags/33216/6 "2020-06-22T05:43:26Z")

</div>

You can create an ansible group and put that host in that group
