Schedule playbook

Hi Team,

can any one help me ,how to create the schedule playbook and how we can schedule the play book for the same.

Regards,
Kumar.M

Hello, we’d love to help, but we need a little more information about the problem you’re having. Screenshots, log outputs, or any reproducers would be very helpful.

If you are looking for general help on making a schedule in AWX the user guide has some pretty good details of how that works: https://docs.ansible.com/automation-controller/latest/html/userguide/scheduling.html

-The AWX Team

Hi Team,
The same how to write the play book on backend. Like i need to write the playbook to schedule the job.Can you share me once playbook ,how to write the playbook with options.for example,need to run a playbook for a particular time

Hi there,

Are you asking for help running a playbook to run on a schedule or a playbook that runs a scheduled job? Because if it is latter, you either want this:

https://docs.ansible.com/ansible/latest/collections/ansible/posix/at_module.html

Or this:

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html

If the former, the link that the AWX provided should be sufficient to get started.

  • Rilindo

Hi Team,
thank you for the reply.here is my play book and i want to schedule this play book for a certain time.

Assuming the “Demo job Template” exists in your instance and you have set the appropriate environment variables to connect to a Tower instance this playbook would create a schedule within Tower to run the Demo Job template once on 20220727T130551Z.

If you created a job template from this playbook and scheduled that job template to run through Tower it would then just create or update (depending on your value of the sched1 variable) a schedule in Tower on a schedule (its kind of redundant to schedule a playbook that creates a schedule especially with a fixed date like you have above).

Playbooks on their own (without AWX/Tower) don’t have a way to “reschedule” themselves unless, like Rilindo said, you use the playbook to schedule its own execution through cron or at.

If the above does not help, could you clarify Is there is a specific problem with your playbook above that you are hitting?

-The AWX Team

P.S. As a side note, if you are using Tower and not AWX (as indicated by the module name) you can also reach out to Red Hat for help.

For example,
I have one playbook called,uptime for example.And that play book need to execute at some point of time and need help,how we can write the playbook for the same.

Regards,
Prasanna.M