From 8a754e0858d922e955e71b253c139e071ecec432 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 18:04:21 +0200 Subject: Adding upstream version 2.14.3. Signed-off-by: Daniel Baumann --- .../getting_started/network_connection_options.rst | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/docsite/rst/network/getting_started/network_connection_options.rst (limited to 'docs/docsite/rst/network/getting_started/network_connection_options.rst') diff --git a/docs/docsite/rst/network/getting_started/network_connection_options.rst b/docs/docsite/rst/network/getting_started/network_connection_options.rst new file mode 100644 index 0000000..bdfb93c --- /dev/null +++ b/docs/docsite/rst/network/getting_started/network_connection_options.rst @@ -0,0 +1,48 @@ +.. _network_connection_options: + +*************************************** +Working with network connection options +*************************************** + +Network modules can support multiple connection protocols, such as ``ansible.netcommon.network_cli``, ``ansible.netcommon.netconf``, and ``ansible.netcommon.httpapi``. These connections include some common options you can set to control how the connection to your network device behaves. + +Common options are: + +* ``become`` and ``become_method`` as described in :ref:`privilege_escalation`. +* ``network_os`` - set to match your network platform you are communicating with. See the :ref:`platform-specific ` pages. +* ``remote_user`` as described in :ref:`connection_set_user`. +* Timeout options - ``persistent_command_timeout``, ``persistent_connect_timeout``, and ``timeout``. + +.. _timeout_options: + +Setting timeout options +======================= + +When communicating with a remote device, you have control over how long Ansible maintains the connection to that device, as well as how long Ansible waits for a command to complete on that device. Each of these options can be set as variables in your playbook files, environment variables, or settings in your :ref:`ansible.cfg file `. + +For example, the three options for controlling the connection timeout are as follows. + +Using vars (per task): + +.. code-block:: yaml + + - name: save running-config + cisco.ios.ios_command: + commands: copy running-config startup-config + vars: + ansible_command_timeout: 30 + +Using the environment variable: + +.. code-block:: bash + + $export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=30 + +Using the global configuration (in :file:`ansible.cfg`) + +.. code-block:: ini + + [persistent_connection] + command_timeout = 30 + +See :ref:`ansible_variable_precedence` for details on the relative precedence of each of these variables. See the individual connection type to understand each option. -- cgit v1.2.3