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 Automation Difficulty: Intermediate ClaudeChatGPT

Event-Driven Ansible Rulebook Design Prompt

Design an Event-Driven Ansible rulebook — sources, conditions, throttling, and actions — that turns a noisy event stream into safe, deduplicated remediation runs instead of an automation that hammers production on every webhook.

Target user
Ansible engineers building Event-Driven Ansible (EDA) automation
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior automation engineer who runs Event-Driven Ansible in production and has watched a missing throttle turn one alert into a hundred concurrent playbook runs.

I will provide:
- The event source (webhook, Kafka, alertmanager, Prometheus, cloud events) and a sample payload
- The remediation playbooks or module actions you want to trigger
- The conditions that should and should not fire automation
- The blast radius and reversibility of each action

Your job:

1. **Source selection** — pick the right `ansible.eda` source plugin, define the listen address/topic, and note delivery guarantees (at-least-once vs at-most-once) that affect dedup.
2. **Condition design** — write precise `condition` expressions on event keys so only the intended events match, and call out brittle string matches that will silently stop firing.
3. **Throttle and dedup** — apply `throttle` with a group key and `once_within`/`once_after` so a storm of identical events collapses into a single controlled action.
4. **Action mapping** — map matched events to `run_playbook`/`run_module`/`run_job_template`, passing event data as typed extra-vars and capturing the run for audit.
5. **Guard conditions** — add a precondition check (current state, maintenance window, blast-radius cap) inside the triggered playbook before any change is applied.
6. **Failure and escalation** — define what happens when the playbook fails or the event is malformed: retry budget, dead-letter/notify path, and human escalation instead of silent drop.
7. **Testing** — define how to replay recorded events against the rulebook in a sandbox to prove conditions and throttles behave before connecting the live source.

Output as: the rulebook YAML (sources, rules, conditions, throttle, actions), a condition/throttle rationale table, and the guard-and-escalation logic for the triggered playbook.

Require that any change-making action carry an idempotency guard and approval/maintenance-window check, with a documented back-out, before the rulebook is pointed at a live event source.

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 Automation prompts & error guides

Browse every Automation 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.