哪个 ansible.cfg 超时值是“-T"?覆盖 ansible-playbook 命令? [英] Which ansible.cfg timeout value is "-T" overriding on the ansible-playbook command?

查看:33
本文介绍了哪个 ansible.cfg 超时值是“-T"?覆盖 ansible-playbook 命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ansible-playbook 文档 说 -T 将以秒为单位覆盖连接超时(默认值 = 10)".

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

/etc/ansible/ansible.cfg 文件中,在 [persistent_connection] 部分下,有 connect_timeout (默认30 秒)command_timeout (默认 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).

ansible-playbook 文档表明 connect_timeout 被覆盖,但页面指定的默认值与 connect_timeout 默认值不匹配,它匹配 command_timeout 默认值.

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.

那么,ansible-playbook 命令上的 -T 标志是否会覆盖 connect_timeoutcommand_timeout 或其他与其中任何一个无关的超时?

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?

推荐答案

-T 相当于 DEFAULT_TIMEOUT 配置设置.

-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

对于ssh连接插件,它被用作ConnectTimeout=,意思是:

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 大约是:

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

这篇关于哪个 ansible.cfg 超时值是“-T"?覆盖 ansible-playbook 命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆