Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Rollback & Recovery

Direct answer

Rollback and recovery in automation returns systems to a known good state after a failed change, through reverse steps, restored backups or snapshots, or redeploying the previous version.

When to use this

Use this when automation must return systems to a known good state after a failed change.

First 30 seconds

1. Rollback & recovery: backups, checkpoints, transactions, automatic and manual rollback, resume.

2. Plan before changing.

3. Test.

4. Some changes need roll-forward fixes.

5. Verify recovery.

Operational verification

change → failure → rollback/recover → verify

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Automation rollback/recovery patterns / Ansible current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAutomation rollback/recovery patterns / Ansible current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when automation must return systems to a known good state after a failed change.
What next?3 suggested next steps
Child topics (this level)10
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Target-state verification ladder Verify boundary

Rollback & Recovery uses a strict target-state ladder for rollback request to restored effective state: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.

Step 2 Verification path Verify boundary

Before change, verify the recovery point exists and is readable/restorable, capture target version/config and define the service check that will show recovery. During a controlled test, introduce a bounded failure after at least one mutation and verify the workflow identifies partial completion. Execute rollback/recovery according to policy, then independently query configuration/data consistency and consumer-facing service health. For backups/checkpoints, a creation success message is insufficient—perform periodic restore tests. For forward-fix recovery, verify the new state explicitly rather than labelling it rollback. Capture which steps were compensated, which were left in place and why. Finally re-run the original transaction/service operation that motivated recovery to show the system is usable.

Step 3 Where it fails Narrow the fault

Separate original change failure, partial-commit detection, recovery artifact availability, restore/compensation execution, dependent-system convergence and service verification. A backup can be healthy while restore fails; restore can complete while database/application versions are incompatible; rollback can succeed on nine targets while the tenth remains changed. Do not retry the original change until current state is re-established. If target state is uncertain after timeout, inspect it before choosing rollback to avoid double-reversal. Preserve the original evidence and recovery point before additional mutation. Recovery is complete only when intended invariants and consumer-facing service are verified, not when the rollback command exits zero.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Rollback Strategy

A rollback strategy decides in advance how each change is undone — reverse steps, restore backup, redeploy previous version, snapshot revert — and when to trigger it.

Subtopic Configuration Backup

Configuration backup saves the current configuration before a change, such as copying running configs to Git or exporting settings, so the previous state can be restored exactly.

Subtopic State Backup

State backup saves tool state such as Terraform state files, databases or inventories before changes, so automation does not lose track of what it manages if a run goes wrong.

Subtopic Checkpoint

A checkpoint in rollback and recovery is a saved known-good point, such as a config archive, VM snapshot or database savepoint, that the system can return to.

Subtopic Transaction

A transaction groups changes so they all succeed or all fail together, such as a database transaction or NETCONF candidate commit, avoiding half-applied changes.

Subtopic Automatic Rollback

Automatic rollback reverts a change by itself when post-change checks fail, such as a confirmed commit timing out, a deployment health check failing or a pipeline running its rollback job.

Subtopic Manual Rollback

Manual rollback is a documented procedure an engineer follows to undo a change when automatic rollback is not possible or safe, with clear steps and verification.

Subtopic Partial Failure

Partial failure in rollback and recovery means some targets were changed and some not.

Subtopic Resume

Resume in recovery continues a failed job from its last successful checkpoint after the cause is fixed, instead of rolling everything back and starting again.

Subtopic Recovery Verification

Recovery verification confirms that after a rollback or restore, systems are back to the expected configuration and services work, using the same checks as normal post-change verification.

Key points
  • Plan rollback before the change.
  • Back up configuration and state first.
  • Verify after rollback, not just run it.
Key checks
  • Rollback strategy per automation — plan
  • Backups/snapshots before change — restore points
  • Recovery verification — proof
ReferenceWhy it matters1 section · depth on demand

In depth

Rollback and recovery are the plans and mechanisms for returning systems to a known-good state when a change or failure goes wrong. In automation they must be designed and tested as carefully as the change itself.

MechanismExample
Revert configurationconfigure replace, git revert + redeploy
Restore snapshotVM or storage snapshot
Previous artifactRedeploy previous image/tag
Forward fixSmall corrective change
Restore from backupData recovery

Not every change can be rolled back (database migrations, deleted data) — identify those in planning and protect them with backups.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

Rollback and Recovery are not synonyms. Rollback attempts to restore a known previous state or configuration; recovery restores service/consistency and may require a forward fix, failover, replay or selective compensation rather than literal reversal. Many automation operations are not transactionally reversible: external APIs can create durable IDs, schema migrations can destroy information, and fan-out changes can partially complete. A safe design records pre-change state and a recovery point before mutation, tracks exactly which steps/targets committed, and defines compensation per boundary. Block/rescue constructs can orchestrate recovery logic, but successful rescue only means the recovery steps ran according to their tool semantics—it does not show business/service state is healthy.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

For each mutating automation path, classify reversibility before release: reversible by config restore, recoverable from backup/checkpoint, forward-fix only, or manually escalated. Define backup freshness, restore ownership, retention and test cadence. Keep rollback scripts/config under the same review/version control as deployment logic and ensure they support the currently deployed schema/version, not merely the prior one. Avoid automatic rollback for failures where the previous state is unknown or rollback itself can worsen partial data. Record change checkpoints and per-target progress so recovery can be selective. Regularly exercise recovery in a representative environment, including controller restart/interruption. Retire recovery artifacts only after the corresponding deployment/version is no longer recoverable through them.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docAutomation rollback/recovery patterns / Ansible current current

Authoritative/upstream documentation reviewed for bounded claims in > Rollback & Recovery. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.ansible.com/projects/ansible-core/2.18/playbook_guide/playbooks_blocks.html · confidence 94%
Embedded reference data

Quick lookup tables

→ Rollback & Recovery · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for → Rollback & Recovery.

LayerRollback & Recovery operational reference
Runtime/ownershipAutomation rollback/recovery patterns / Ansible current · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationansible-playbook recovery.yml --check --diff; ansible-playbook recovery.yml -vv
Expected interpretationPre-change evidence and recovery points exist, partial completion is identified, rollback/forward-fix changes only demonstrated state, and final service state is independently verified.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Recovery output should preserve change/execution ID, pre-change version/checkpoint/backup ID, completed-step/target set, original failure, selected recovery strategy, each compensation/restore result and final verification. Distinguish “rollback started,” “rollback completed technically,” and “service recovered.” When a rescue handler changes the final automation result, retain the original failure so it is not erased from audit history. For distributed changes, output per-target recovery state and any manual follow-up. Store checksums/version IDs for restored configuration/artifacts where possible. Sensitive backup locations/credentials must be protected. This structure lets an operator show exactly what state was restored instead of relying on a generic recovered flag.

Confirmation

Confirm action

Continue?