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
-
Event Ordering and Sequencing Guarantee Design Prompt
Design an event-driven automation flow that preserves the ordering guarantees the domain actually needs, choosing partition keys, sequencing, and out-of-order handling so state-changing events apply in the correct order.
-
Event Schema Versioning and Contract Evolution Design Prompt
Design a versioning and compatibility strategy for automation event payloads so producers can evolve schemas without breaking existing consumers, with explicit rules for additive, breaking, and deprecation changes.
-
Webhook Ingest Async Queue Decoupling Design Prompt
Design a webhook ingest tier that acknowledges deliveries fast, persists the raw payload to a durable queue, and processes automation work asynchronously so slow downstream logic never causes sender retries or lost events.
-
Event-Driven Fan-In Aggregation Window Design Prompt
Design a fan-in aggregation stage that collects many upstream events into windowed batches before acting — with correct windowing (tumbling/sliding/session), watermarks for late events, idempotent flush, and safe behavior when a partial window's worth of events never arrives.
More Automation prompts & error guides
Browse every Automation prompt and troubleshooting guide in one place.
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.