Reputation: 21
Is there a way to override the timeout on ansible? I'm sending around 700 lines of Cisco iOS config. However I get a timeout error:
ansible.module_utils.connection.ConnectionError: timeout trying to send command
Is there a way to increase the timeout so I can send the full set of lines?
- hosts: 192.168.1.1
connection: network_cli
tasks:
- name: send config
ios_config:
lines:
-config
-config
Upvotes: 2
Views: 2141
Reputation: 2179
They are two tunables for timeout, persistent_connect_timeout
and persistent_command_timeout
. The latter seems to be one you have to change.
You have to edit ansible.cfg
and put this text
[persistent_connection]
command_timeout = 30
You can also as a test define the environment variable ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=30
before launching the playbook so that would apply to all network tasks
Source: https://docs.ansible.com/ansible/2.6/network/user_guide/network_debug_troubleshooting.html#timeouts
Upvotes: 1