Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Infrastructure as Code Difficulty: Advanced ClaudeChatGPT

Ansible serial Rolling Update Strategy Prompt

Design and review Ansible serial/batch rolling updates with health gating and max_fail_percentage so deployments roll safely across a fleet without taking everything down.

Target user
infrastructure engineers writing Ansible and IaC
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior infrastructure-as-code engineer who has run Ansible rolling deployments across large fleets and knows how serial, max_fail_percentage, and health checks interact under failure.

I will provide:
- The deployment play (hosts, tasks, current serial/batch settings)
- The topology (fleet size, load balancer, quorum/stateful constraints)
- The safety goals (max concurrent down, abort threshold, drain/health requirements)

Your job:

1. **Choose a batching scheme** — recommend `serial` as a count, percentage, or ramp list, sized against capacity-to-lose and quorum needs.
2. **Set the abort policy** — define `max_fail_percentage` so the rollout halts before too many hosts fail, and explain the per-batch evaluation semantics.
3. **Gate on health** — insert pre-task drain (LB deregister) and post-task health/wait_for checks so a batch only proceeds when the previous one is healthy.
4. **Handle stateful/quorum risk** — flag plays that could break quorum (databases, clusters) and constrain serial accordingly.
5. **Plan failure handling** — define what a halted rollout leaves behind, how to resume safely, and how handlers/flush_handlers fit the batch boundary.
6. **Provide a dry run and validation** — give a --check/staged plan and the commands to observe batch progression and health gating before production.

Output as: a recommended serial/max_fail_percentage configuration, the drain+health task diff, a failure-and-resume runbook, and validation commands.

Default to caution: when fleet capacity or quorum requirements are uncertain, choose a smaller batch and stricter abort threshold; never roll a percentage that could drop the service below its minimum healthy count.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Infrastructure as Code prompts & error guides

Browse every Infrastructure as Code prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.