diff options
| author | lucaelin <git@luca.lsys.ac> | 2026-02-23 13:25:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-23 12:25:35 +0000 |
| commit | e539028c2f9d062e7684abda5dd32affd92e9f08 (patch) | |
| tree | 26bdccd9ae304c9d4eef843e60eb61f7ad54e3df /tests/integration | |
| parent | 8d96e7a700d30667c594ab7880538451f60d7fb4 (diff) | |
| download | vyos.vyos-e539028c2f9d062e7684abda5dd32affd92e9f08.tar.gz vyos.vyos-e539028c2f9d062e7684abda5dd32affd92e9f08.zip | |
add commit-confirm options to vyos_config (#229)
* added vyos_config confirm options
* fix: update commit comment to match main
* fix: documentation example for automatic confirm
* fix: add tests for commit confirm and confirm_timeout options
* fix: add config_confirm changelog fragment
* fix: lint missing diff parameter for edit_config
* fix: add commit confirm integration test
---------
Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/targets/vyos_config/tests/cli/confirm.yaml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/integration/targets/vyos_config/tests/cli/confirm.yaml b/tests/integration/targets/vyos_config/tests/cli/confirm.yaml new file mode 100644 index 00000000..73674a17 --- /dev/null +++ b/tests/integration/targets/vyos_config/tests/cli/confirm.yaml @@ -0,0 +1,44 @@ +--- +- debug: msg="START cli/confirm.yaml on connection={{ ansible_connection }}" + +- name: setup + vyos.vyos.vyos_config: + lines: set system host-name {{ inventory_hostname_short }} + match: none + +- name: configure with confirm (manual) + register: result + vyos.vyos.vyos_config: + lines: set system host-name foo + comment: confirm manual test + confirm: manual + confirm_timeout: 1 + +- assert: + that: + - result.changed == true + - "'set system host-name foo' in result.commands" + +- name: verify hostname changed to foo + register: hostname_after + vyos.vyos.vyos_command: + commands: show host name + +- assert: + that: + - "'foo' in hostname_after.stdout[0]" + +- name: wait until config auto-reverts (no confirmation) + register: hostname_reverted + vyos.vyos.vyos_command: + commands: show host name + retries: 18 + delay: 5 + until: inventory_hostname_short in hostname_reverted.stdout[0] + +- name: teardown + vyos.vyos.vyos_config: + lines: set system host-name {{ inventory_hostname_short }} + match: none + +- debug: msg="END cli/confirm.yaml on connection={{ ansible_connection }}" |
