From ecff3e2cfa93ca7c3694559c79bce65300c5fc7d Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Thu, 17 Sep 2026 18:31:48 +1000 Subject: T6828: PR190 revive, vyos_conf match "enforced" (#415) * T6828: PR190 revive, vyos_conf match "enforced" --- docs/vyos.vyos.vyos_config_module.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/vyos.vyos.vyos_config_module.rst b/docs/vyos.vyos.vyos_config_module.rst index 054ae208..bdc0df07 100644 --- a/docs/vyos.vyos.vyos_config_module.rst +++ b/docs/vyos.vyos.vyos_config_module.rst @@ -167,11 +167,12 @@ Parameters
The confirm argument will tell vyos to revert to the previous configuration if not explicitly confirmed after applying the new config. When set to automatic this module will automatically confirm the configuration, if the current session remains working with the new config. When set to manual, this module does not issue the confirmation itself.
+
Defaults to automatic when match is set to enforce, since enforce can generate delete commands for configuration not mentioned in the candidate and a bad commit should self-revert rather than leave the device unreachable. Defaults to none for all other match values.
@@ -219,11 +220,12 @@ Parameters -
The match argument controls the method used to match against the current active configuration. By default, the desired config is matched against the active config and the deltas are loaded. If the match argument is set to none the active configuration is ignored and the configuration is always loaded.
+
The match argument controls the method used to match against the current active configuration. By default, the desired config is matched against the active config and the deltas are loaded. If the match argument is set to none, the active configuration is ignored and the configuration is always loaded. If the match argument is set to enforce, the supplied lines or src are treated as the complete desired end-state of the configuration, rather than a set of deltas to apply. enforce enforces only the top-level configuration sections present in the supplied candidate as complete end-states; existing configuration within those sections but not mentioned in the candidate is removed, so enforce can generate delete commands for configuration the candidate does not mention. Top-level sections the candidate does not reference at all are left completely untouched. enforce is intended for candidates made up of set commands only; supplying delete lines alongside match=enforce is not supported and will raise an error.
Ignored when replace is set to config, since no line-level diff is computed in that mode.
@@ -326,6 +328,7 @@ Examples - name: render a Jinja2 template onto the VyOS router vyos.vyos.vyos_config: + match: enforce src: vyos_template.j2 - name: revert after ten minutes, if connection is lost -- cgit v1.2.3