From 9a0deaabf0d046db4e99c20d09b04e8c2f5fef1c Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:23:41 +1000 Subject: T8989: ospv2 dict_op refactor (#30) * T8989: vyos_ospfv2 dict_op refactor * T8989: vyos_ospfv2 dict_op refactor * T8989: ospv2 AI comment fixes --------- Co-authored-by: Daniil Baturin --- docs/vyos.rest.vyos_ospfv2_module.rst | 841 +++++++++++++++++++++++++++------- 1 file changed, 688 insertions(+), 153 deletions(-) (limited to 'docs') diff --git a/docs/vyos.rest.vyos_ospfv2_module.rst b/docs/vyos.rest.vyos_ospfv2_module.rst index 1c5c248..9e0c41b 100644 --- a/docs/vyos.rest.vyos_ospfv2_module.rst +++ b/docs/vyos.rest.vyos_ospfv2_module.rst @@ -19,7 +19,8 @@ Synopsis -------- - Manages OSPFv2 configuration on VyOS devices via the REST API. - Uses REST API (``connection=httpapi``) instead of CLI. -- In VyOS 1.5+, passive interfaces use per-interface config rather than passive-interface. +- Scope matches the current vyos.vyos.vyos_ospfv2 (CLI collection) module: areas (including virtual_link), auto_cost, default_information, default_metric, distance, log_adjacency_changes, max_metric, mpls_te, neighbor, parameters, passive_interface, passive_interface_exclude, redistribute, timers. VyOS's OSPF schema is considerably larger than even this -- access-list, aggregation, capability, graceful-restart, ldp-sync, maximum-paths, per-interface tuning (bandwidth/hello-multiplier/network-type/authentication/intervals beyond passive), segment-routing, and summary-address are not modeled here, matching real gaps in the CLI module's own scope, not oversights. +- A standalone top-level ``route_map`` field exists in the CLI module's argspec but does not correspond to any real device path -- confirmed against a live VyOS 1.5.0 device's ``set protocols ospf`` completions, which list no ``route-map`` entry at that level (only nested under ``default-information originate`` and per-protocol under ``redistribute``, both of which are modeled here). Deliberately omitted rather than built against a confirmed non-functional field. @@ -31,12 +32,12 @@ Parameters - + - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + + - + + - + + + + + - - - - + + - + + - + + + + - - - - + - - - - - + - - - - + - + + - + + - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterParameter Choices/Defaults Comments
+
config @@ -52,7 +53,7 @@ Parameters
+
areas @@ -70,7 +71,7 @@ Parameters
+
area_id @@ -88,7 +89,7 @@ Parameters
+
area_type @@ -106,7 +107,7 @@ Parameters
+
normal @@ -128,7 +129,7 @@ Parameters
+
nssa @@ -147,7 +148,7 @@ Parameters
+
default_cost @@ -166,7 +167,7 @@ Parameters
+
no_summary @@ -189,7 +190,7 @@ Parameters
+
set @@ -212,7 +213,7 @@ Parameters
+
translate @@ -236,7 +237,7 @@ Parameters
+
stub @@ -255,7 +256,7 @@ Parameters
+
default_cost @@ -274,7 +275,7 @@ Parameters
+
no_summary @@ -297,7 +298,7 @@ Parameters
+
set @@ -320,7 +321,7 @@ Parameters
+
authentication @@ -341,7 +342,7 @@ Parameters
+
network @@ -360,7 +361,7 @@ Parameters
+
address @@ -379,7 +380,7 @@ Parameters
+
range @@ -398,7 +399,7 @@ Parameters
+
address @@ -417,7 +418,7 @@ Parameters
+
cost @@ -435,7 +436,7 @@ Parameters
+
not_advertise @@ -457,7 +458,7 @@ Parameters
+
substitute @@ -475,7 +476,7 @@ Parameters
+
shortcut @@ -494,46 +495,50 @@ Parameters
Shortcut mode.
- auto_cost + virtual_link
- dictionary + list + / elements=dictionary
-
Auto-cost reference bandwidth.
+
Virtual link.
- reference_bandwidth + address
- integer + string + / required
-
Reference bandwidth in Mbps.
+
Virtual link address (router ID of the remote ABR).
+
- default_information + authentication
dictionary @@ -542,109 +547,115 @@ Parameters
-
Default route distribution.
+
Virtual link authentication.
+
- originate + md5
- dictionary + list + / elements=dictionary
-
Originate default route.
+
MD5 key id based authentication.
+
- always + key_id
- boolean + integer
-
    Choices: -
  • no
  • -
  • yes
  • -
-
Always advertise default route.
+
MD5 key id (1-255).
+
- metric + md5_key
- integer + string
-
Metric for default route.
+
MD5 key (16 characters or less).
- metric_type + plaintext_password
- integer + string
-
Metric type.
+
Plain text password (8 characters or less).
+
- route_map + dead_interval
- string + integer
-
Route map.
+
Interval after which a neighbor is declared dead.
+
- default_metric + hello_interval
integer @@ -653,31 +664,34 @@ Parameters
-
Default metric for redistributed routes.
+
Interval between hello packets.
+
- distance + retransmit_interval
- dictionary + integer
-
Administrative distances.
+
Interval between retransmitting lost link state advertisements.
- global + transmit_delay
integer @@ -686,15 +700,16 @@ Parameters
-
Global OSPFv2 distance.
+
Link state transmit delay.
+
- ospf + auto_cost
dictionary @@ -703,16 +718,15 @@ Parameters
-
Per-route-type distances.
+
Auto-cost reference bandwidth.
+
- external + reference_bandwidth
integer @@ -721,124 +735,126 @@ Parameters
-
External route distance.
+
Reference bandwidth in Mbps.
+
- inter_area + default_information
- integer + dictionary
-
Inter-area route distance.
+
Default route distribution.
+
- intra_area + originate
- integer + dictionary
-
Intra-area route distance.
+
Originate default route.
+
- log_adjacency_changes + always
- string + boolean
    Choices: -
  • detail
  • +
  • no
  • +
  • yes
-
Log adjacency changes.
+
Always advertise default route.
+
- neighbor + metric
- list - / elements=dictionary + integer
-
OSPF neighbors.
+
Metric for default route.
- neighbor_id + metric_type
- string - / required + integer
-
Neighbor IP.
+
Metric type.
- poll_interval + route_map
- integer + string
-
Poll interval.
+
Route map.
+
- priority + default_metric
integer @@ -847,15 +863,14 @@ Parameters
-
Neighbor priority.
+
Default metric for redistributed routes.
+
- parameters + distance
dictionary @@ -864,57 +879,400 @@ Parameters
-
OSPFv2 parameters.
+
Administrative distances.
+
- abr_type + global
- string + integer
-
    Choices: -
  • cisco
  • -
  • ibm
  • -
  • shortcut
  • -
  • standard
  • -
-
ABR type.
+
Global OSPFv2 distance.
+
- opaque_lsa + ospf
- boolean + dictionary
-
    Choices: -
  • no
  • -
  • yes
  • -
-
Enable opaque LSA.
+
Per-route-type distances.
+
+ external + +
+ integer +
+
+ +
External route distance.
+
+
+ inter_area + +
+ integer +
+
+ +
Inter-area route distance.
+
+
+ intra_area + +
+ integer +
+
+ +
Intra-area route distance.
+
+
+ log_adjacency_changes + +
+ string +
+
+
    Choices: +
  • detail
  • +
+
+
Log adjacency changes.
+
+
+ max_metric + +
+ dictionary +
+
+ +
OSPFv2 maximum/infinite-distance metric.
+
+
+ router_lsa + +
+ dictionary +
+
+ +
Advertise own Router-LSA with infinite distance (stub router).
+
+
+ administrative + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Administratively apply, for an indefinite period.
+
+
+ on_shutdown + +
+ integer +
+
+ +
Time (seconds) to advertise self as stub-router before shutdown.
+
+
+ on_startup + +
+ integer +
+
+ +
Time (seconds) to advertise self as stub-router on startup.
+
+
+ mpls_te + +
+ dictionary +
+
+ +
MPLS Traffic Engineering parameters.
+
+
+ enabled + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Enable MPLS-TE functionality.
+
+
+ router_address + +
+ string +
+
+ +
Stable IP address of the advertising router.
+
+
+ neighbor + +
+ list + / elements=dictionary +
+
+ +
OSPF neighbors.
+
+
+ neighbor_id + +
+ string + / required +
+
+ +
Neighbor IP.
+
+
+ poll_interval + +
+ integer +
+
+ +
Poll interval.
+
+
+ priority + +
+ integer +
+
+ +
Neighbor priority.
+
+
+ parameters + +
+ dictionary +
+
+ +
OSPFv2 parameters.
+
+
+ abr_type + +
+ string +
+
+
    Choices: +
  • cisco
  • +
  • ibm
  • +
  • shortcut
  • +
  • standard
  • +
+
+
ABR type.
+
+
+ opaque_lsa + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Enable opaque LSA.
+
rfc1583_compatibility @@ -935,7 +1293,7 @@ Parameters
+
router_id @@ -952,7 +1310,7 @@ Parameters
+
passive_interface @@ -964,12 +1322,29 @@ Parameters
-
Passive interfaces (VyOS 1.5+: configured via protocols ospf interface <name> passive).
+
Interfaces to suppress routing updates on, via per-interface configuration (protocols ospf interface <name> passive).
+ +
+ passive_interface_exclude + +
+ list + / elements=string +
+
+ +
Interfaces to explicitly exclude from passive mode (via protocols ospf interface <name> passive disable) -- e.g. when passive is otherwise applied broadly.
+
redistribute @@ -987,7 +1362,7 @@ Parameters
+
metric @@ -1004,7 +1379,7 @@ Parameters
+
metric_type @@ -1021,7 +1396,7 @@ Parameters
+
route_map @@ -1038,7 +1413,7 @@ Parameters
+
route_type @@ -1060,9 +1435,156 @@ Parameters
+
+ timers + +
+ dictionary +
+
+ +
Routing timers.
+
+
+ refresh + +
+ dictionary +
+
+ +
Refresh parameters.
+
+
+ timers + +
+ integer +
+
+ +
Refresh timer (seconds).
+
+
+ throttle + +
+ dictionary +
+
+ +
Throttling adaptive timers.
+
+
+ spf + +
+ dictionary +
+
+ +
SPF timers.
+
+
+ delay + +
+ integer +
+
+ +
Delay (ms) from first change received to SPF calculation.
+
+
+ initial_holdtime + +
+ integer +
+
+ +
Initial hold time (ms) between consecutive SPF calculations.
+
+
+ max_holdtime + +
+ integer +
+
+ +
Maximum hold time (ms).
+
state @@ -1096,9 +1618,16 @@ Notes .. note:: - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. - - VyOS 1.5+ uses per-interface passive configuration rather than the global ``passive-interface`` command used in VyOS 1.4. +See Also +-------- + +.. seealso:: + + :ref:`vyos.vyos.vyos_ospfv2_module` + The official documentation on the **vyos.vyos.vyos_ospfv2** module. + Examples -------- @@ -1119,10 +1648,6 @@ Examples normal: true network: - address: 192.0.2.0/24 - - area_id: "3" - area_type: - nssa: - set: true - area_id: "4" area_type: stub: @@ -1135,6 +1660,16 @@ Examples metric: 10 passive_interface: - eth1 + max_metric: + router_lsa: + administrative: true + mpls_te: + enabled: true + router_address: 192.0.11.11 + timers: + throttle: + spf: + delay: 200 state: merged - name: Delete all OSPFv2 configuration -- cgit v1.2.3