I want a task to fail if it takes longer than 2 hours to run

11 views
Skip to first unread message

John Simmons

unread,
Jul 22, 2019, 7:06:56 AM7/22/19
to Ansible Project
I have a task that I need to run a command module for, but I need it to fail after a specific amount of time. I'm going to be using blocks so I can then move to recovery when it fails.
what's the best way of assigning a timeout to a task?

Many thanks in advance

John

Kai Stian Olstad

unread,
Jul 22, 2019, 7:31:26 AM7/22/19
to ansible...@googlegroups.com
On 22.07.2019 13:06, John Simmons wrote:
> I have a task that I need to run a command module for, but I need it to
> fail after a specific amount of time. I'm going to be using blocks so I
> can
> then move to recovery when it fails.
> what's the best way of assigning a timeout to a task?

With async
https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages