# gather\_timeout in ansible.cfg DEPRECATED

**URL:** <https://forum.ansible.com/t/gather-timeout-in-ansible-cfg-deprecated/37920>\
**Category:** Ansible Project\
**Created:** [April 24, 2023, 1:29pm UTC](https://forum.ansible.com/t/gather-timeout-in-ansible-cfg-deprecated/37920 "2023-04-24T13:29:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [April 24, 2023, 1:29pm UTC](https://forum.ansible.com/t/gather-timeout-in-ansible-cfg-deprecated/37920/1 "2023-04-24T13:29:55Z")

</div>

Hi,

I have this in our ansible.cfg:

[defaults]  
gather\_timeout = 60

With ansible 7, I get:

[DEPRECATION WARNING]: DEFAULT\_GATHER\_TIMEOUT option, the module\_defaults keyword is a more generic version and can apply to all calls to the M(ansible.builtin.gather\_facts)  
or M(ansible.builtin.setup) actions, use module\_defaults instead. This feature will be removed from ansible-core in version 2.18. Deprecation warnings can be disabled by  
setting deprecation\_warnings=False in ansible.cfg.

It seems that the equivalent of that single line in ansble.cfg, is that add this to every play in our playbook:

module\_defaults:  
ansible.builtin.setup:  
gather\_timeout: 60  
ansible.builtin.gather\_facts:  
gather\_timeout: 60

We have many plays, which means a lot of extra (duplicated) code.  
Is there a way to set this more centrally?  
Or am I missing something entirely 🙂

thx!

Dick

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [April 24, 2023, 5:30pm UTC](https://forum.ansible.com/t/gather-timeout-in-ansible-cfg-deprecated/37920/2 "2023-04-24T17:30:43Z")

</div>

In a play it looks like you can just add `gather_timeout: 60` still so that is less to add but your findings are spot on otherwise.

- name: ‘A playbook’  
hosts: printservers  
gather\_timeout: 60  
tasks:
- name: ‘Do something’  
ansible.builtin.debug:  
var: ansible\_play\_hosts\_all
