fix: remove auto-revert timer, use checkpoint + write memory instead

Config is committed to running-config immediately (no 5-min timer).
Safety net is the checkpoint (rollback) and the fact that startup-config
is only written with -e commit=true. A reboot reverts uncommitted changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix/kind-mount-propagation
A. F. Dudley 2026-03-07 01:49:25 +00:00
parent 742e84e3b0
commit 9f6e1b5da7
1 changed files with 16 additions and 16 deletions

View File

@ -22,7 +22,7 @@
# ansible-playbook -i inventory/switches.yml playbooks/ashburn-relay-mia-sw01.yml \ # ansible-playbook -i inventory/switches.yml playbooks/ashburn-relay-mia-sw01.yml \
# -e apply=true # -e apply=true
# #
# # Commit persisted config # # Persist to startup-config (write memory)
# ansible-playbook -i inventory/switches.yml playbooks/ashburn-relay-mia-sw01.yml -e commit=true # ansible-playbook -i inventory/switches.yml playbooks/ashburn-relay-mia-sw01.yml -e commit=true
# #
# # Rollback # # Rollback
@ -73,23 +73,22 @@
ansible.builtin.meta: end_play ansible.builtin.meta: end_play
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# Commit finalization # Write memory (persist to startup-config)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
- name: Finalize pending session - name: Write memory to persist config
when: commit | bool when: commit | bool
block: block:
- name: Commit session and write memory - name: Write memory
arista.eos.eos_command: arista.eos.eos_command:
commands: commands:
- "configure session {{ session_name }} commit"
- write memory - write memory
register: commit_result register: write_result
- name: Show commit result - name: Show write result
ansible.builtin.debug: ansible.builtin.debug:
var: commit_result.stdout_lines var: write_result.stdout_lines
- name: End play after commit - name: End play after write
ansible.builtin.meta: end_play ansible.builtin.meta: end_play
# ------------------------------------------------------------------ # ------------------------------------------------------------------
@ -222,10 +221,10 @@
ansible.builtin.debug: ansible.builtin.debug:
var: session_diff.stdout_lines var: session_diff.stdout_lines
- name: Commit with 5-minute auto-revert - name: Commit session (checkpoint saved for rollback)
arista.eos.eos_command: arista.eos.eos_command:
commands: commands:
- "configure session {{ session_name }} commit timer 00:05:00" - "configure session {{ session_name }} commit"
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# Verify # Verify
@ -247,8 +246,7 @@
- name: Reminder - name: Reminder
ansible.builtin.debug: ansible.builtin.debug:
msg: | msg: |
=== Config applied with 5-minute auto-revert === === Config applied (running-config only) ===
Session: {{ session_name }}
Checkpoint: {{ checkpoint_name }} Checkpoint: {{ checkpoint_name }}
Changes applied: Changes applied:
@ -257,9 +255,11 @@
link {{ tunnel_local }}/31, ACL {{ tunnel_acl }} link {{ tunnel_local }}/31, ACL {{ tunnel_acl }}
3. Route: {{ ashburn_ip }}/32 via {{ tunnel_remote }} 3. Route: {{ ashburn_ip }}/32 via {{ tunnel_remote }}
The config will auto-revert in 5 minutes unless committed. Config is in running-config but NOT saved to startup-config.
Verify on the switch, then commit: A reboot will revert to the previous state.
To persist (write memory):
ansible-playbook ... -e commit=true ansible-playbook ... -e commit=true
To revert immediately: To rollback immediately:
ansible-playbook ... -e rollback=true ansible-playbook ... -e rollback=true