# Looking for a Way to Set a Global Task Timeout in Ansible

**URL:** <https://forum.ansible.com/t/looking-for-a-way-to-set-a-global-task-timeout-in-ansible/42495>\
**Category:** Get Help\
**Tags:** ansible-core\
**Created:** [May 7, 2025, 10:32am UTC](https://forum.ansible.com/t/looking-for-a-way-to-set-a-global-task-timeout-in-ansible/42495 "2025-05-07T10:32:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 7, 2025, 3:44pm UTC](https://forum.ansible.com/t/looking-for-a-way-to-set-a-global-task-timeout-in-ansible/42495/4 "2025-05-07T15:44:40Z")

</div>

It does work for me: I created an `ansible.cfg` file:

```auto
[defaults]
task_timeout=2

```

next to a test playbook:

```auto
- hosts: localhost
  gather_facts: false
  tasks:
    - ansible.builtin.command: /bin/sh -c 'sleep 10'

```

When running the playbook, I get:

```auto
[ERROR]: Task failed: Action failed: The ansible.builtin.command action failed to execute in the expected time frame (2) and was terminated

```

---

_[View the full topic](https://forum.ansible.com/t/looking-for-a-way-to-set-a-global-task-timeout-in-ansible/42495)._
