mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Add default Network timeout values to network troubleshooting guide (#51555)
* add toc and default timeout values * make options more obvious
This commit is contained in:
parent
e284d21139
commit
9c058d3121
1 changed files with 52 additions and 46 deletions
|
@ -4,6 +4,9 @@
|
||||||
Network Debug and Troubleshooting Guide
|
Network Debug and Troubleshooting Guide
|
||||||
***************************************
|
***************************************
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:local:
|
||||||
|
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
|
@ -14,8 +17,6 @@ This section discusses how to debug and troubleshoot network modules in Ansible
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
How to troubleshoot
|
How to troubleshoot
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
@ -442,11 +443,10 @@ of inactivity), simple delete the socket file.
|
||||||
Timeout issues
|
Timeout issues
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Timeouts
|
Persistent connection idle timeout
|
||||||
--------
|
----------------------------------
|
||||||
Persistent connection idle timeout:
|
|
||||||
|
|
||||||
For example:
|
By default, ``ANSIBLE_PERSISTENT_CONNECT_TIMEOUT`` is set to 30 (seconds). You may see the following error if this value is too low:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
@ -467,8 +467,12 @@ To make this a permanent change, add the following to your ``ansible.cfg`` file:
|
||||||
[persistent_connection]
|
[persistent_connection]
|
||||||
connect_timeout = 60
|
connect_timeout = 60
|
||||||
|
|
||||||
Command timeout:
|
Command timeout
|
||||||
For example:
|
---------------
|
||||||
|
|
||||||
|
By default, ``ANSIBLE_PERSISTENT_COMMAND_TIMEOUT`` is set to 30 (seconds). Prior versions of Ansible had this value set to 10 seconds by default.
|
||||||
|
You may see the following error if this value is too low:
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
@ -476,53 +480,53 @@ For example:
|
||||||
|
|
||||||
Suggestions to resolve:
|
Suggestions to resolve:
|
||||||
|
|
||||||
Options 1 (Global command timeout setting):
|
* Option 1 (Global command timeout setting):
|
||||||
Increase value of command timeout in configuration file or by setting environment variable.
|
Increase value of command timeout in configuration file or by setting environment variable.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=60
|
export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=60
|
||||||
|
|
||||||
To make this a permanent change, add the following to your ``ansible.cfg`` file:
|
To make this a permanent change, add the following to your ``ansible.cfg`` file:
|
||||||
|
|
||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|
||||||
[persistent_connection]
|
[persistent_connection]
|
||||||
command_timeout = 60
|
command_timeout = 60
|
||||||
|
|
||||||
Option 2 (Per task command timeout setting):
|
* Option 2 (Per task command timeout setting):
|
||||||
Increase command timeout per task basis. All network modules support a
|
Increase command timeout per task basis. All network modules support a
|
||||||
timeout value that can be set on a per task basis.
|
timeout value that can be set on a per task basis.
|
||||||
The timeout value controls the amount of time in seconds before the
|
The timeout value controls the amount of time in seconds before the
|
||||||
task will fail if the command has not returned.
|
task will fail if the command has not returned.
|
||||||
|
|
||||||
For local connection type:
|
For local connection type:
|
||||||
|
|
||||||
.. FIXME: Detail error here
|
.. FIXME: Detail error here
|
||||||
|
|
||||||
Suggestions to resolve:
|
Suggestions to resolve:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: save running-config
|
- name: save running-config
|
||||||
ios_command:
|
ios_command:
|
||||||
commands: copy running-config startup-config
|
commands: copy running-config startup-config
|
||||||
provider: "{{ cli }}"
|
provider: "{{ cli }}"
|
||||||
timeout: 30
|
timeout: 30
|
||||||
|
|
||||||
For network_cli, netconf connection type (applicable from 2.7 onwards):
|
For network_cli, netconf connection type (applicable from 2.7 onwards):
|
||||||
|
|
||||||
.. FIXME: Detail error here
|
.. FIXME: Detail error here
|
||||||
|
|
||||||
Suggestions to resolve:
|
Suggestions to resolve:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
- name: save running-config
|
- name: save running-config
|
||||||
ios_command:
|
ios_command:
|
||||||
commands: copy running-config startup-config
|
commands: copy running-config startup-config
|
||||||
vars:
|
vars:
|
||||||
ansible_command_timeout: 60
|
ansible_command_timeout: 60
|
||||||
|
|
||||||
Some operations take longer than the default 30 seconds to complete. One good
|
Some operations take longer than the default 30 seconds to complete. One good
|
||||||
example is saving the current running config on IOS devices to startup config.
|
example is saving the current running config on IOS devices to startup config.
|
||||||
|
@ -530,8 +534,10 @@ In this case, changing the timeout value from the default 30 seconds to 60
|
||||||
seconds will prevent the task from failing before the command completes
|
seconds will prevent the task from failing before the command completes
|
||||||
successfully.
|
successfully.
|
||||||
|
|
||||||
Persistent socket connect timeout:
|
Persistent connection retry timeout
|
||||||
For example:
|
-----------------------------------
|
||||||
|
|
||||||
|
By default, ``ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT`` is set to 15 (seconds). You may see the following error if this value is too low:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
@ -696,21 +702,21 @@ Example ssh config file (~/.ssh/config)
|
||||||
IdentityFile "/path/to/ssh-key.pem"
|
IdentityFile "/path/to/ssh-key.pem"
|
||||||
Port 22
|
Port 22
|
||||||
|
|
||||||
# Note: Due to the way that Paramiko reads the SSH Config file,
|
# Note: Due to the way that Paramiko reads the SSH Config file,
|
||||||
# you need to specify the NETCONF port that the host uses.
|
# you need to specify the NETCONF port that the host uses.
|
||||||
# i.e. It does not automatically use ansible_port
|
# i.e. It does not automatically use ansible_port
|
||||||
# As a result you need either:
|
# As a result you need either:
|
||||||
|
|
||||||
Host junos01
|
Host junos01
|
||||||
HostName junos01
|
HostName junos01
|
||||||
ProxyCommand ssh -W %h:22 jumphost
|
ProxyCommand ssh -W %h:22 jumphost
|
||||||
|
|
||||||
# OR
|
# OR
|
||||||
|
|
||||||
Host junos01
|
Host junos01
|
||||||
HostName junos01
|
HostName junos01
|
||||||
ProxyCommand ssh -W %h:830 jumphost
|
ProxyCommand ssh -W %h:830 jumphost
|
||||||
|
|
||||||
# Depending on the netconf port used.
|
# Depending on the netconf port used.
|
||||||
|
|
||||||
Example Ansible inventory file
|
Example Ansible inventory file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue