summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-09-16 13:24:50 +1000
committeromnom62 <omnom62@outlook.com>2026-09-16 13:24:50 +1000
commit2eb21fd0e2f921ce995464c95eb54554102e8b0e (patch)
tree89afcc9e74ad97ee4491e285892113103aeb8a85
parent030e6fa0124e02ef21442f55dd95d668d91eb214 (diff)
downloadrest.vyos-T8989_ospv2_dict_op_refactor.tar.gz
rest.vyos-T8989_ospv2_dict_op_refactor.zip
T8989: ospv2 AI comment fixesT8989_ospv2_dict_op_refactor
-rw-r--r--changelogs/fragments/t8989_ospv2_dict_op.yml4
-rw-r--r--docs/vyos.rest.vyos_ospfv2_module.rst2
-rw-r--r--plugins/modules/vyos_ospfv2.py10
3 files changed, 10 insertions, 6 deletions
diff --git a/changelogs/fragments/t8989_ospv2_dict_op.yml b/changelogs/fragments/t8989_ospv2_dict_op.yml
index ce9a303..5a0f78d 100644
--- a/changelogs/fragments/t8989_ospv2_dict_op.yml
+++ b/changelogs/fragments/t8989_ospv2_dict_op.yml
@@ -1,3 +1,5 @@
---
minor_changes:
- - vyos_ospfv2 - Dict_op module refactor.
+ - vyos_ospfv2 - refactor command generation onto ``dict_op``.
+ - vyos_ospfv2 - add support for ``areas[].virtual_link``, ``max_metric``,
+ ``mpls_te``, ``timers``, and ``passive_interface_exclude``.
diff --git a/docs/vyos.rest.vyos_ospfv2_module.rst b/docs/vyos.rest.vyos_ospfv2_module.rst
index 3dc7a9e..9e0c41b 100644
--- a/docs/vyos.rest.vyos_ospfv2_module.rst
+++ b/docs/vyos.rest.vyos_ospfv2_module.rst
@@ -19,7 +19,7 @@ Synopsis
--------
- Manages OSPFv2 configuration on VyOS devices via the REST API.
- Uses REST API (``connection=httpapi``) instead of CLI.
-- 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.
+- 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.
diff --git a/plugins/modules/vyos_ospfv2.py b/plugins/modules/vyos_ospfv2.py
index 299233f..efdd2a5 100644
--- a/plugins/modules/vyos_ospfv2.py
+++ b/plugins/modules/vyos_ospfv2.py
@@ -21,8 +21,8 @@ description:
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),
+ 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.
- >-
@@ -534,11 +534,13 @@ def _vlink_auth_to_device(auth):
device = {}
md5_list = auth.get("md5") or []
if md5_list:
- device["md5"] = {
+ md5_device = {
str(entry["key_id"]): {"md5-key": entry["md5_key"]}
for entry in md5_list
- if entry.get("key_id") is not None
+ if entry.get("key_id") is not None and entry.get("md5_key") is not None
}
+ if md5_device:
+ device["md5"] = md5_device
if auth.get("plaintext_password"):
device["plaintext-password"] = auth["plaintext_password"]
return device