|
|
@ -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
|
|
|
|
|
|
|
|
|
|
|
|