有没有办法覆盖ansible的超时?我正在发送大约700行思科iOS配置 . 但是我收到超时错误:
ansible.module_utils.connection.ConnectionError: timeout trying to send command
有没有办法增加超时,所以我可以发送完整的行集?
- hosts: 192.168.1.1
connection: network_cli
tasks:
- name: send config
ios_config:
lines:
-config
-config
1 回答
它们是两个超时可调参数,
persistent_connect_timeout
和persistent_command_timeout
. 后者似乎是你必须改变的 . 您必须编辑ansible.cfg
并输入此文本您还可以在启动Playbook之前定义环境变量
ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=30
,以便适用于所有网络任务资料来源:https://docs.ansible.com/ansible/2.6/network/user_guide/network_debug_troubleshooting.html#timeouts