summaryrefslogtreecommitdiff
path: root/plugins/modules
diff options
context:
space:
mode:
authoromnom62 <omnom62@outlook.com>2026-06-29 07:20:36 +1000
committeromnom62 <omnom62@outlook.com>2026-06-29 07:20:36 +1000
commit6be14447461593f2c71088b54fe523cb468e32dd (patch)
tree63d4d069f82ae3b5c602dbe56948896799b1a624 /plugins/modules
parentcf9ca1a7c3788dfcbb1df35270f7e52a52af203e (diff)
downloadrest.vyos-6be14447461593f2c71088b54fe523cb468e32dd.tar.gz
rest.vyos-6be14447461593f2c71088b54fe523cb468e32dd.zip
T8989: SIT and UAT updates
Diffstat (limited to 'plugins/modules')
-rw-r--r--plugins/modules/vyos_logging_global.py8
-rw-r--r--plugins/modules/vyos_route_maps.py15
2 files changed, 14 insertions, 9 deletions
diff --git a/plugins/modules/vyos_logging_global.py b/plugins/modules/vyos_logging_global.py
index 09fdd6b..f18ba3f 100644
--- a/plugins/modules/vyos_logging_global.py
+++ b/plugins/modules/vyos_logging_global.py
@@ -305,7 +305,7 @@ def normalize_running(raw):
for f, data in raw.get("console", {}).get("facility", {}).items():
result["console"]["facilities"][f] = data.get("level")
- g = raw.get("global", {})
+ g = raw.get("local", {})
for f, data in g.get("facility", {}).items():
result["global"]["facilities"][f] = data.get("level")
if "archive" in g:
@@ -315,7 +315,7 @@ def normalize_running(raw):
if "preserve-fqdn" in g:
result["global"]["preserve_fqdn"] = True
- for host, data in raw.get("host", {}).items():
+ for host, data in raw.get("remote", {}).items():
h = {"port": data.get("port"), "facilities": {}}
for f, fd in data.get("facility", {}).items():
h["facilities"][f] = {
@@ -402,7 +402,7 @@ def build_commands(want, have, state):
)
cmds += diff_facilities(
- ["system", "syslog", "global"],
+ ["system", "syslog", "local"],
want["global"]["facilities"],
have["global"]["facilities"],
state,
@@ -416,7 +416,7 @@ def build_commands(want, have, state):
)
cmds += diff_map(
- ["system", "syslog", "host"],
+ ["system", "syslog", "remote"],
want["hosts"],
have["hosts"],
state,
diff --git a/plugins/modules/vyos_route_maps.py b/plugins/modules/vyos_route_maps.py
index 55b1706..607d1ab 100644
--- a/plugins/modules/vyos_route_maps.py
+++ b/plugins/modules/vyos_route_maps.py
@@ -308,7 +308,7 @@ def _want_to_api_match(match):
return api
-def _rule_cmds(rm_name, rule, have_rule):
+def _rule_cmds(rm_name, rule, have_rule, state="merged"):
cmds = []
seq = str(rule["sequence"])
rbase = _BASE + [rm_name, "rule", seq]
@@ -343,8 +343,13 @@ def _rule_cmds(rm_name, rule, have_rule):
want_set_api = _want_to_api_set(rule.get("set"))
have_set = have_rule.get("set") or {}
- if want_set_api != have_set:
- cmds += _set_cmds(rbase, rule.get("set"))
+ if state in ("replaced", "overridden"):
+ if want_set_api != have_set:
+ cmds += _set_cmds(rbase, rule.get("set"))
+ else:
+ have_subset = {k: have_set[k] for k in want_set_api if k in have_set}
+ if want_set_api != have_subset:
+ cmds += _set_cmds(rbase, rule.get("set"))
return cmds
@@ -380,7 +385,7 @@ def build_commands(config, have_raw, state):
test_cmds = []
for rule in rm.get("entries") or []:
have_rule = have_entries.get(str(rule["sequence"]), {})
- test_cmds += _rule_cmds(rm_name, rule, have_rule)
+ test_cmds += _rule_cmds(rm_name, rule, have_rule, state)
if test_cmds or extra_seqs:
cmds.append(("delete", _BASE + [rm_name]))
have_rm = {}
@@ -391,7 +396,7 @@ def build_commands(config, have_raw, state):
for rule in rm.get("entries") or []:
have_rule = have_entries.get(str(rule["sequence"]), {})
- cmds += _rule_cmds(rm_name, rule, have_rule)
+ cmds += _rule_cmds(rm_name, rule, have_rule, state)
return cmds