Ansible 重试选项,any_errors_fatal



我们有一个部署手册,它依赖于我们通过ssh连接的堡垒服务器后面的几台服务器。偶尔服务器暂时无法连接,但重试应该可以工作。

如果我将重试选项添加到 [ssh_connection] 部分,它仍然有效或被any_errors_fatal覆盖。

在 ansible 中.cfg我们有以下选项

[defaults]
private_key_file = <Key_location>
remote_user = <remote_user>
host_key_checking = False
any_errors_fatal = True
[ssh_connection]
pipelining=true
control_path = %(directory)s/%%C
retries = 3

尝试设置超时值 = 60 并重新测试。 我在下面的默认部分下配置了 timeout=60。

[defaults]
private_key_file = <Key_location>
remote_user = <remote_user>
host_key_checking = False
any_errors_fatal = True
timeout=60

相关内容

最新更新