Configure rulebooks to take action in response to events or conditions
In Event-Driven Ansible, a rulebook activation is a process running in the background defined by a decision environment executing a specific rulebook.
Set up a rulebook activation Copy linkLink copied!
Follow the steps in this procedure to set up a rulebook activation.
Before you begin Copy linkLink copied!
- You have set up a project.
- You have set up a decision environment.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
Your rulebook activation is now created and can be managed on the Rulebook Activations page.
After saving the new rulebook activation, the rulebook activation’s details page is displayed, with either a Pending, Running, or Failed status. From there or the Rulebook Activations list view, you can restart or delete it.
Rulebook activation list view Copy linkLink copied!
Use the Rulebook Activations list view to quickly monitor the operational status, event fire count, and restart frequency of all your deployed automation services.
If the Status is Running, it means that the rulebook activation is running in the background and executing the required actions according to the rules declared in the rulebook.
You can view more details by selecting the activation from the Rulebook Activations list view.
For all activations that have run, you can view the Details and History tabs to get more information about what happened.
Enable and disable rulebook activations Copy linkLink copied!
Toggle the state of an activation to start or stop event processing instantly, allowing for temporary pauses, maintenance, or troubleshooting without deletion.
Procedure Copy linkLink copied!
- Select the switch on the row level to enable or disable your chosen rulebook.
- In the window, select .
- Select .
Restart rulebook activations Copy linkLink copied!
Restart an activation to immediately apply configuration changes, update rulebook content, or quickly recover from unexpected failures.
About this task Copy linkLink copied!
You can only restart a rulebook activation if it is currently enabled and the restart policy was set to Always when it was created.
Procedure Copy linkLink copied!
- Select the icon ⋮ next to Rulebook Activation enabled/disabled toggle.
- Select .
- In the window, select .
- Select .
Delete rulebook activations Copy linkLink copied!
End and permanently remove a rulebook activation and its configuration when its automated event-driven workflow is no longer required.
Procedure Copy linkLink copied!
- Select the icon ⋮ next to the Rulebook Activation enabled/disabled toggle.
- Select .
- In the window, select .
- Select .
Activate webhook-based automation in Openshift Copy linkLink copied!
In Openshift environments, you can activate webhooks by creating a route to expose the activation’s service, enabling external systems to send events and trigger automation.
Before you begin Copy linkLink copied!
- You have created a rulebook activation.
The following is an example of rulebook with a given webhook:
- name: Listen for storage-monitor events
hosts: all
sources:
- ansible.eda.webhook:
host: 0.0.0.0
port: 5000
rules:
- name: Rule - Print event information
condition: event.meta.headers is defined
action:
run_job_template:
name: StorageRemediation
organization: Default
job_args:
extra_vars:
message: from eda
sleep: 1