Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which ansible.cfg timeout value is "-T" overriding on the ansible-playbook command?

Tags:

ansible

The ansible-playbook documentation says that -T will "override the connection timeout in seconds (default=10)".

In the /etc/ansible/ansible.cfg file, under the [persistent_connection] section, there's connect_timeout (default 30 sec) and command_timeout (default 10 sec).

The ansible-playbook documentation would suggest it's the connect_timeout being overridden, but the default value that page specifies doesn't match the connect_timeout default value, it matches the command_timeout default value.

So, does the -T flag on the ansible-playbook command override the connect_timeout, command_timeout, or some other timeout not related to either of those?

like image 960
bdx Avatar asked Dec 03 '25 14:12

bdx


1 Answers

-T is an equivalent of DEFAULT_TIMEOUT configuration setting.

DEFAULT_TIMEOUT:
  default: 10
  description: This is the default timeout for connection plugins to use.
  env:
  - {name: ANSIBLE_TIMEOUT}
  ini:
  - {key: timeout, section: defaults}
  name: Connection timeout
  type: integer

For ssh connections plugin is it used as ConnectTimeout=<value>, meaning:

ConnectTimeout
   Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout.
   This value is used only when the target is down or really unreachable, not when it refuses the connection.

command_timeout is about:

PERSISTENT_COMMAND_TIMEOUT:
  default: 10
  description: This controls the amount of time to wait for response from remote device
    before timing out presistent connection.
  env:
  - {name: ANSIBLE_PERSISTENT_COMMAND_TIMEOUT}
  ini:
  - {key: command_timeout, section: persistent_connection}
  name: Persistence command timeout
  type: int
like image 153
Konstantin Suvorov Avatar answered Dec 05 '25 23:12

Konstantin Suvorov