Hey Dick,

This bit seems to be confusing:


      DEFAULT_GATHER_TIMEOUTīƒ
      
<https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-gather-timeout>

Description:

    Set the timeout in seconds for the implicit fact gathering, see
    the module documentation for specifics. It does *not* apply to
    user defined ansible_collections.ansible.builtin.setup_module
    
<https://docs.ansible.com/ansible/9/collections/ansible/builtin/setup_module.html#ansible-collections-ansible-builtin-setup-module>
    tasks.

I think there's a historical wart here. When a playbook contains "gather_facts: true", it calls the gather_facts module. This in turn calls the setup module to accomplish the fact gathering. In that case /only/, and only if DEFAULT_GATHER_TIMEOUT is set, it will invoke the setup module with, effectively, "timeout: '{{ DEFAULT_GATHER_TIMEOUT }}'".

The last line I quoted above means that if you, somewhere in your tasks, call the setup module, it won't use DEFAULT_GATHER_TIMEOUT, and if you don't include a "timeout:" yourself, in that case the setup module's default of 10 seconds will be used rather than whatever value DEFAULT_GATHER_TIMEOUT may be set to.

`ansible-config dump` shows the default value for DEFAULT_GATHER_TIMEOUT is None -- it's undefined, and in fact will soon be going away. When you don't set it, and nothing else sets the timeout for the setup module, that module uses its 10 second default.

Does that get at what you were asking?
--
Todd

On 3/25/24 10:54 AM, Dick Visser wrote:
Hii

While upgrading ansible we run into a deprecation warning:

[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.

This is behave we have this in ansible.cfg:

gather_timeout = 60

I intend to use the recommended module_defaults, but it is not clear
to me to what exactly this setting applies. According to
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-gather-timeout:

"Set the timeout in seconds for the implicit fact gathering, see the
module documentation for specifics. It does not apply to user defined
ansible_collections.ansible.builtin.setup_module tasks."

If I read this correctly, DEFAULT_GATHER_TIMEOUT is only for
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html
- right?

In any case, neither pages list a default for this.

https://docs.ansible.com/ansible/9/collections/ansible/builtin/setup_module.html#parameter-gather_timeout
lists 10 seconds, but according to the line above that is something
else altogether.

So, what is the default for DEFAULT_GATHER_TIMEOUT?

thx

Dick


--
Todd

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4390ecd8-4d33-4cff-bb1f-d9a52ccbcc7a%40gmail.com.

Reply via email to