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
Follow the steps in this procedure to set up a rulebook activation.
Before you begin
- You have set up a project.
- You have set up a decision environment.
Procedure
Results
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
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
Toggle the state of an activation to start or stop event processing instantly, allowing for temporary pauses, maintenance, or troubleshooting without deletion.
Procedure
- Select the switch on the row level to enable or disable your chosen rulebook.
- In the window, select .
- Select .
Restart rulebook activations
Restart an activation to immediately apply configuration changes, update rulebook content, or quickly recover from unexpected failures.
About this task
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
- Select the icon ⋮ next to Rulebook Activation enabled/disabled toggle.
- Select .
- In the window, select .
- Select .
Delete rulebook activations
End and permanently remove a rulebook activation and its configuration when its automated event-driven workflow is no longer required.
Procedure
- Select the icon ⋮ next to the Rulebook Activation enabled/disabled toggle.
- Select .
- In the window, select .
- Select .
Activate webhook-based automation in Openshift
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
- 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