Ansible IOS_Config超时覆盖



有没有办法覆盖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

它们是超时的两个可调参数,persistent_connect_timeoutpersistent_command_timeout。后者似乎是你必须改变的。 您必须编辑ansible.cfg并放置此文本

[persistent_connection]
command_timeout = 30

您还可以在启动 playbook 之前定义环境变量ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=30作为测试,以便适用于所有网络任务

来源: https://docs.ansible.com/ansible/2.6/network/user_guide/network_debug_troubleshooting.html#timeouts

最新更新