From 60866aeb2f743a404e045ce64a2c0912c689c6a9 Mon Sep 17 00:00:00 2001 From: omnom62 Date: Tue, 19 May 2026 08:44:50 +1000 Subject: route_map --- docs/vyos.rest.vyos_prefix_lists_module.rst | 191 ++++--- docs/vyos.rest.vyos_route_maps_module.rst | 802 +++++----------------------- 2 files changed, 242 insertions(+), 751 deletions(-) (limited to 'docs') diff --git a/docs/vyos.rest.vyos_prefix_lists_module.rst b/docs/vyos.rest.vyos_prefix_lists_module.rst index 6e1d288..53321c9 100644 --- a/docs/vyos.rest.vyos_prefix_lists_module.rst +++ b/docs/vyos.rest.vyos_prefix_lists_module.rst @@ -5,7 +5,7 @@ vyos.rest.vyos_prefix_lists *************************** -**Prefix-Lists resource module via REST API.** +**Manage prefix-list configuration on VyOS devices using REST API** Version added: 1.0.0 @@ -17,7 +17,8 @@ Version added: 1.0.0 Synopsis -------- -- Manages IPv4 and IPv6 prefix lists on VyOS via the HTTPS REST API. +- Manages IPv4 and IPv6 prefix lists on VyOS via the REST API. +- Uses REST API (``connection=httpapi``) instead of CLI. @@ -33,21 +34,6 @@ Parameters Choices/Defaults Comments - - -
- api_key - -
- string - / required -
- - - - - -
@@ -61,7 +47,7 @@ Parameters -
List of prefix-list configurations.
+
List of prefix-list configurations grouped by address family.
@@ -82,7 +68,7 @@ Parameters -
Address family.
+
Address family identifier.
@@ -116,7 +102,7 @@ Parameters -
Description.
+
Prefix list description.
@@ -156,7 +142,7 @@ Parameters -
permit or deny.
+
Permit or deny.
@@ -174,6 +160,7 @@ Parameters +
Rule description.
@@ -270,36 +257,6 @@ Parameters - - -
- hostname - -
- string - / required -
- - - - - - - - -
- port - -
- integer -
- - - Default:
443
- - - -
@@ -319,49 +276,67 @@ Parameters - - - - -
- timeout - -
- integer -
- - - Default:
30
- - - - - - -
- verify_ssl - -
- boolean -
- - - - - +
Desired state of the prefix-list configuration.
+
merged adds or updates entries without removing existing ones.
+
replaced replaces each named prefix list mentioned in config.
+
overridden replaces all prefix lists for the given AFIs.
+
deleted removes prefix lists. Without config removes all.
+
gathered returns current configuration as structured data.

+Notes +----- +.. note:: + - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. + - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. +Examples +-------- + +.. code-block:: yaml + + - name: Merge prefix list configuration + vyos.rest.vyos_prefix_lists: + config: + - afi: ipv4 + prefix_lists: + - name: AnsibleIPv4PrefixList + description: PL configured by ansible + entries: + - sequence: 2 + action: permit + prefix: 92.168.10.0/26 + le: 32 + - sequence: 3 + action: deny + prefix: 72.168.2.0/24 + ge: 26 + - afi: ipv6 + prefix_lists: + - name: AllowIPv6Prefix + entries: + - sequence: 5 + action: permit + prefix: 2001:db8:8000::/35 + le: 37 + state: merged + + - name: Delete all prefix lists + vyos.rest.vyos_prefix_lists: + state: deleted + + - name: Gather current prefix list configuration + vyos.rest.vyos_prefix_lists: + state: gathered + + Return Values ------------- @@ -386,6 +361,7 @@ Common return values are documented `here when changed +
Prefix list configuration after this module ran.

@@ -400,6 +376,7 @@ Common return values are documented `here always +
Prefix list configuration before this module ran.

@@ -414,6 +391,52 @@ Common return values are documented `here always +
List of API command tuples sent to the device.
+
+ + + + +
+ gathered + +
+ list +
+ + when state is gathered + +
Current prefix list configuration as structured data.
+
+ + + + +
+ response + +
+ dictionary +
+ + when changes are applied + +
Raw API response.
+
+ + + + +
+ saved + +
+ boolean +
+ + when changes are applied + +
Whether the config was saved after changes.

diff --git a/docs/vyos.rest.vyos_route_maps_module.rst b/docs/vyos.rest.vyos_route_maps_module.rst index 0f41805..4fc0801 100644 --- a/docs/vyos.rest.vyos_route_maps_module.rst +++ b/docs/vyos.rest.vyos_route_maps_module.rst @@ -5,7 +5,7 @@ vyos.rest.vyos_route_maps ************************* -**Route Map resource module via REST API.** +**Manage route-map configuration on VyOS devices using REST API** Version added: 1.0.0 @@ -17,7 +17,8 @@ Version added: 1.0.0 Synopsis -------- -- Manages route maps on VyOS via the HTTPS REST API. +- Manages route maps on VyOS via the REST API. +- Uses REST API (``connection=httpapi``) instead of CLI. @@ -29,583 +30,66 @@ Parameters - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterParameter Choices/Defaults Comments
-
- api_key - -
- string - / required -
-
- -
-
- config - -
- list - / elements=dictionary -
-
- -
List of route-map configurations.
-
-
- entries - -
- list - / elements=dictionary -
-
- -
Route map rules.
-
-
- action - -
- string -
-
-
    Choices: -
  • permit
  • -
  • deny
  • -
-
-
permit or deny.
-
-
- call - -
- string -
-
- -
Call another route map.
-
-
- continue_sequence - -
- integer -
-
- -
Continue at a different sequence.
-
-
- description - -
- string -
-
- -
-
- match - -
- dictionary -
-
- -
Match conditions.
-
-
- interface - -
- string -
-
- -
-
- ip - -
- dictionary -
-
- -
-
- nexthop_address - -
- string -
-
- -
-
- nexthop_prefix_list - -
- string -
-
- -
-
- ipv6 - -
- dictionary -
-
- -
-
- nexthop_address - -
- string -
-
- -
-
- metric - -
- integer -
-
- -
-
- origin - -
- string -
-
- -
-
- prefix_list - -
- string -
-
- -
-
- prefix_list6 - -
- string -
-
- -
-
- sequence - -
- integer -
-
- -
Rule number (1-65535).
-
-
- set - -
- dictionary -
-
- -
Route parameters to set.
-
-
- aggregator - -
- dictionary -
-
- -
-
- as - -
- string -
-
- -
-
- ip - -
- string -
-
- -
-
- as_path_prepend - -
- string -
-
- -
-
- atomic_aggregate - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
-
- bgp_extcommunity_rt - -
- string -
-
- -
+
- community + config
- dictionary + list + / elements=dictionary
+
List of route-map configurations.
-
- value - -
- string -
-
- -
-
- ip_next_hop - -
- string -
-
- -
- ipv6_next_hop + entries
- dictionary + list + / elements=dictionary
+
Route map rules.
- ip_type + action
string
-
    Choices: -
  • global
  • -
  • local
  • -
+
Permit or deny.
- value - -
- string -
-
- -
-
- large_community + call
string @@ -614,15 +98,15 @@ Parameters
+
Call another route map.
+
- local_preference + continue_sequence
integer @@ -631,66 +115,15 @@ Parameters
+
Continue at a different sequence number.
-
- metric - -
- string -
-
- -
-
- metric_type - -
- string -
-
- -
-
- origin - -
- string -
-
- -
+
- originator_id + description
string @@ -699,69 +132,71 @@ Parameters
+
Rule description.
+
- src + match
- string + dictionary
+
Match conditions (passed through to VyOS API).
+
- tag + sequence
- string + integer + / required
+
Rule sequence number (1-65535).
+
- weight + set
- integer + dictionary
+
Route parameters to set (passed through to VyOS API).
+
route_map
string + / required
@@ -772,37 +207,7 @@ Parameters
-
- hostname - -
- string - / required -
-
- -
-
- port - -
- integer -
-
- Default:
443
-
-
+
state @@ -820,47 +225,62 @@ Parameters
-
-
- timeout - -
- integer -
-
- Default:
30
-
-
-
- verify_ssl - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
+
Desired state of the route-map configuration.
+
merged adds or updates entries without removing existing ones.
+
replaced replaces each named route map mentioned in config.
+
overridden replaces all route maps.
+
deleted removes route maps. Without config removes all.
+
gathered returns current configuration as structured data.

+Notes +----- + +.. note:: + - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. + - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. + - Input validation is delegated to the VyOS API. + +Examples +-------- + +.. code-block:: yaml + + - name: Merge route map configuration + vyos.rest.vyos_route_maps: + config: + - route_map: RM-TEST-EXPORT-POLICY + entries: + - sequence: 10 + action: permit + match: + peer: 192.0.2.32 + set: + metric: "5" + as_path_exclude: "111" + aggregator: + as: 100 + state: merged + + - name: Delete all route maps + vyos.rest.vyos_route_maps: + state: deleted + + - name: Delete a specific route map + vyos.rest.vyos_route_maps: + config: + - route_map: RM-TEST-EXPORT-POLICY + state: deleted + + - name: Gather current route map configuration + vyos.rest.vyos_route_maps: + state: gathered @@ -887,6 +307,7 @@ Common return values are documented `here when changed +
Route map configuration after this module ran.

@@ -901,6 +322,7 @@ Common return values are documented `here always +
Route map configuration before this module ran.

@@ -915,6 +337,52 @@ Common return values are documented `here always +
List of API command tuples sent to the device.
+
+ + + + +
+ gathered + +
+ list +
+ + when state is gathered + +
Current route map configuration as structured data.
+
+ + + + +
+ response + +
+ dictionary +
+ + when changes are applied + +
Raw API response.
+
+ + + + +
+ saved + +
+ boolean +
+ + when changes are applied + +
Whether the config was saved after changes.

-- cgit v1.2.3