Event-Driven Ansible with ansible-rulebook
Expert · 45 minutes · 100 points
Master Event-Driven Ansible (EDA) by installing ansible-rulebook, writing rulebooks that respond to file system events and webhook triggers, creating custom event sources, and chaining rules with conditions and actions. You will build a complete event-driven automation pipeline from scratch, simulating real-world scenarios where infrastructure reacts automatically to events.
What you’ll learn
- Install and verify ansible-rulebook and its dependencies including Java runtime and ansible-runner
- Write a functional rulebook YAML that listens to file-system watch events and triggers an Ansible playbook action
- Create a custom Python event source plugin that emits structured JSON events
- Build a multi-rule rulebook using conditions, filters, and multiple action types including run_playbook and run_module
- Validate event-driven pipelines by injecting synthetic events and confirming automated responses
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: python:3.11-slim-bookworm
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- At least 4GB RAM available for the container
- Internet access for package downloads
Topics: ansible, event-driven-ansible, eda, ansible-rulebook, automation, event-sourcing, drools, infrastructure-automation, python, async
Create a free account to start this lab.