diff options
| author | LiudmylaNad <l.nadolina@vyos.io> | 2026-04-21 12:23:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-21 11:23:24 +0100 |
| commit | 18887344844019fda86c38b054bee3d1a2936461 (patch) | |
| tree | 78b4f3e750affb69195ee0983a9693ac2d5f270e | |
| parent | f6c9cf9711632e24d98a995bcde34998a02d71c2 (diff) | |
| download | vyos-documentation-18887344844019fda86c38b054bee3d1a2936461.tar.gz vyos-documentation-18887344844019fda86c38b054bee3d1a2936461.zip | |
DOC: Proofread vyos-ansible.rst, vyos-napalm.rst, and vyos-netmiko.rst (#1836)
| -rw-r--r-- | docs/automation/vyos-ansible.rst | 37 | ||||
| -rw-r--r-- | docs/automation/vyos-napalm.rst | 44 | ||||
| -rw-r--r-- | docs/automation/vyos-netmiko.rst | 17 |
3 files changed, 61 insertions, 37 deletions
diff --git a/docs/automation/vyos-ansible.rst b/docs/automation/vyos-ansible.rst index 993d1b21..12d4e9fb 100644 --- a/docs/automation/vyos-ansible.rst +++ b/docs/automation/vyos-ansible.rst @@ -1,4 +1,4 @@ -:lastproofread: 2023-01-16 +:lastproofread: 2026-04-13 .. _vyos-ansible: @@ -6,10 +6,13 @@ Ansible ####### -VyOS supports configuration via ansible. -Need to install ``ansible`` and ``python3-paramiko`` module +VyOS can be configured using Ansible. To use it, install the ``ansible`` +package and the ``python3-paramiko`` module. -Structure of files +Directory structure +------------------- + +Arrange your Ansible project directory as follows: .. code-block:: none @@ -24,7 +27,7 @@ Structure of files File contents ------------- -ansible.cfg +* ``ansible.cfg`` .. code-block:: none @@ -33,14 +36,19 @@ ansible.cfg retry_files_enabled = False ANSIBLE_INVENTORY_UNPARSED_FAILED = true -id_rsa_docker.pub. Needs to declare only public key exactly. +* ``id_rsa_docker.pub`` + +Contains only the SSH public key. .. code-block:: none AAAAB3NzaC1yc2EAAAADAQABAAABAQCoDgfhQJuJRFWJijHn7ZinZ3NWp4hWVrt7HFcvn0kgtP/5PeCtMt -hosts +* ``hosts`` + +Defines the target VyOS devices and the connection parameters required to reach +them. .. code-block:: none @@ -54,7 +62,9 @@ hosts ansible_network_os=vyos ansible_connection=network_cli -main.yml +* ``main.yml`` + +Defines the configuration tasks to be applied to the target VyOS devices. .. code-block:: none @@ -77,18 +87,19 @@ main.yml - set system time-zone America/Los_Angeles - set interfaces ethernet eth0 description WAN -Run ansible +Run Ansible ----------- +To apply the configuration, use the following command: + .. code-block:: none $ ansible-playbook -i hosts main.yml - PLAY [r11] ****************************************************************************************************************************************************************************************************** + PLAY [r11] ************************************************************************************************************** - TASK [Configure remote r11] ************************************************************************************************************************************************************************************* - changed: [r11] + TASK [Configure remote r11] ********************************************************************************************* - PLAY RECAP ***************************************************************************************************************************************************************************************************** + PLAY RECAP ************************************************************************************************************** r11 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 diff --git a/docs/automation/vyos-napalm.rst b/docs/automation/vyos-napalm.rst index dc4d154f..f2f27124 100644 --- a/docs/automation/vyos-napalm.rst +++ b/docs/automation/vyos-napalm.rst @@ -1,15 +1,19 @@ -:lastproofread: 2023-01-16 +:lastproofread: 2026-04-13 .. _vyos-napalm: -###### -Napalm -###### +################## +NAPALM VyOS driver +################## -VyOS supports some napalm_ functions for configuration and op-mode. -It requires more tests. +VyOS can be configured using the `NAPALM VyOS driver`_, which enables you to +retrieve device data and apply configurations via SSH. -Install ``napalm-vyos`` module +.. note:: + + The ``napalm-vyos`` module is currently in testing. + +To use the NAPALM VyOS driver, install the following packages: .. code-block:: none @@ -18,8 +22,11 @@ Install ``napalm-vyos`` module pip3 install napalm-vyos -Op-mode -------- +Retrieve device data +-------------------- + +The following script connects to a VyOS device, retrieves device facts and +the ARP table, and prints the output in JSON format. .. code-block:: none @@ -46,7 +53,7 @@ Op-mode vyos_router.close() -Output op-mode +Output: .. code-block:: none @@ -82,12 +89,14 @@ Output op-mode } ] -Configuration -------------- +Apply a configuration +--------------------- -We need 2 files, commands.conf and script itself. +To apply a configuration using NAPALM VyOS driver, you will need a file with +configuration commands (``commands.conf``) and a script that executes and +commits them (``vyos-napalm.py``). -Content of commands.conf +* ``commands.conf`` .. code-block:: none @@ -97,7 +106,7 @@ Content of commands.conf set system name-server '203.0.113.8' set interfaces ethernet eth1 description 'FOO' -Script vyos-napalm.py +* ``vyos-napalm.py`` .. code-block:: none @@ -127,7 +136,7 @@ Script vyos-napalm.py vyos_router.close() -Output +Output: .. code-block:: none @@ -142,4 +151,5 @@ Output +name-server 203.0.113.8 [edit] -.. _napalm: https://napalm.readthedocs.io/en/latest/base.html
\ No newline at end of file +.. _napalm: https://napalm.readthedocs.io/en/latest/base.html +.. _NAPALM VyOS driver: https://github.com/napalm-automation-community/napalm-vyos
\ No newline at end of file diff --git a/docs/automation/vyos-netmiko.rst b/docs/automation/vyos-netmiko.rst index 53082e52..b94b0129 100644 --- a/docs/automation/vyos-netmiko.rst +++ b/docs/automation/vyos-netmiko.rst @@ -1,4 +1,4 @@ -:lastproofread: 2023-01-16 +:lastproofread: 2026-04-13 .. _vyos-netmiko: @@ -6,11 +6,14 @@ Netmiko ####### -VyOS supports configuration via netmiko_. -It requires to install ``python3-netmiko`` module. +VyOS can be configured using Netmiko_. To use Netmiko, install the +``python3-netmiko`` module. Example ------- +The following script connects to a VyOS device, applies configuration changes, +commits them, and runs an operational mode command to verify the updated +configuration. .. code-block:: none @@ -41,7 +44,7 @@ Example output = net_connect.commit() print(output) - # op-mode commands + # operational mode commands output = net_connect.send_command("run show interfaces") print(output) @@ -53,12 +56,12 @@ Output configure set interfaces ethernet eth0 description WAN [edit] - vyos@r4-1.3# set interfaces ethernet eth1 description LAN + vyos@r4-1.5# set interfaces ethernet eth1 description LAN [edit] - vyos@r4-1.3# + vyos@r4-1.5# commit [edit] - vyos@r4-1.3# + vyos@r4-1.5# Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- |
