首页 文章

ansible IOS_Config超时覆盖

提问于
浏览
2

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

  • 0

    它们是两个超时可调参数, 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

相关问题