Set up new projects, the automation decision environment, and integration with automation controller so that Event-Driven Ansible controller can launch job templates based on events monitored by Ansible Rulebooks.
Certain resources must be created and configured in Event-Driven Ansible controller before you can use it to run Ansible Rulebooks. The following list provides a brief explanation of each resource type.
Credentials allow authentication to external resources. These external resources include container registries (such as private automation hub, quay.io, and so on), and source code management tools (such as GitLab and GitHub).
Projects contain Ansible Rulebooks and the rulebooks must be in either the rulebooks or extensions/eda/rulebooks directories in the project directory.
If cloning the project repository requires authentication, then you must create a source code management credential.
Currently, the only project source code management type available is Git, and the repository must be accessible via HTTP/HTTPS.
Automation decision environments are container images and they have a similar purpose to automation execution environments. Event-Driven Ansible controller uses automation decision environments to run rulebooks. Adding an automation decision environment might require a container registry credential.
The Automation Hub Default Decision Environment automation decision environment is already created in the classroom environment.
You need to create a controller token for every Event-Driven Ansible controller user. Controller tokens authenticate to automation controller for the purpose of running job and workflow templates from rulebooks. Automation controller must contain the job and workflow templates that the rulebooks are configured to launch.
Rulebook activations specify how to run a rulebook on Event-Driven Ansible controller. Each rulebook activation defines a project, a rulebook, and an automation decision environment. If desired, you can include variables that become available to your rulebook. Event-Driven Ansible controller runs any enabled rulebook activation.
Rule audits are generated automatically by Event-Driven Ansible controller when a rule in a running rulebook activation triggers an action. Clicking a rule name in the rule audit list enables you to inspect the event that triggered the rule and the action taken by the rule.
Use the following steps to create a credential resource in the Event-Driven Ansible controller.
Log in to the Event-Driven Ansible controller web UI.
Navigate to → and then click .
![]() |
In the field, you can enter either a token or the password for the specified user.
Click to create the credential resource.
After you create the credential, the web UI displays the credentials details page. From there or from the credentials list view, you can edit or delete the credential.
Creating a project depends upon the following resources:
A source code management (SCM) credential resource in the Event-Driven Ansible controller (if the SCM repository requires authentication)
An SCM repository containing rulebooks in either the rulebooks or extensions/eda/rulebooks directories in the project directory.
Use the following steps to create a project resource in the Event-Driven Ansible controller:
Log in to the Event-Driven Ansible controller web UI.
Navigate to and then click .
Complete the form and then click to create the project resource.
Git SCM is currently the only available option.
The SCM URL cannot be changed after the project is created.
After you create the project, the web UI displays the project details page. From there or from the projects list view, you can edit or delete the project.
Creating a controller token requires that you have already created a user token in automation controller.
Use the following steps to create a user token in automation controller and then create the controller token resource in Event-Driven Ansible controller.
Log in to the automation controller web UI.
Click your username in the upper right of the page and then click .
![]() |
Click the tab and then click .
![]() |
The following fields are available:
| Field | Description |
|---|---|
Application
| The name of the application (optional) |
Description
| A description of the token (optional) |
Scope
| The level of access that the token has |
The Scope field must be set to Write.
Click to create the token. The web UI displays the generated token. Save or copy the value of the token.
![]() |
Log in to the Event-Driven Ansible controller web UI.
Click your username in the upper right corner and then click .
Click the tab and then click .
The following fields are available:
| Field | Description |
|---|---|
Name
| The name of the controller token |
Description
| A description of the controller token (optional) |
Token
| The value of the token saved or copied from automation controller |
![]() |
Click to create the controller token. After you create the token, the web UI displays the tab, where you can view the token details such as the expiration date, or delete the token.
Creating a rulebook activation requires that you have already created the following resources:
A controller token resource in the Event-Driven Ansible controller
A synced project that contains rulebooks in the Event-Driven Ansible controller
An automation decision environment resource in the Event-Driven Ansible controller
Use the following steps to create a rulebook activation resource in Event-Driven Ansible controller:
Log in to the Event-Driven Ansible controller web UI.
Navigate to and then click .
The following fields are available:
| Field | Description |
|---|---|
Name
| The name of the rulebook activation |
Description
| A description of the rulebook activation (optional) |
Project
| The project that contains the rulebooks |
Rulebook
| The rulebook that the activation runs |
Decision environment
| The automation decision environment that runs the rulebook |
Restart policy
| A policy that decides when to restart the rulebook |
Variables
| Variable names and values to pass to the rulebook (optional) |
Rulebook activation enabled
| An option to enable the rulebook activation on creation |
![]() |
Click to create the rulebook activation resource.
After you create the rulebook activation, the web UI displays the rulebook activation details page. From there or from the rulebook activation list view, you can edit or delete the rulebook activation.
To run a job template or a workflow template using Event-Driven Ansible controller, a rulebook must use either the run_job_template or run_workflow_template actions.
The following is an example of using the run_job_template and run_workflow_template actions in a rulebook:
...output omitted... actions: - run_job_template: name: Sync production repository organization: Production - run_workflow_template: name: Build lastest version of production app organization: Production ...output omitted...
Both actions support the following arguments.
| Field | Required | Description |
|---|---|---|
Name
| Yes | The name of the job or workflow template |
organization
| Yes | The name of the organization |
set_facts
| No | The artifacts from the job or workflow template execution that are inserted back into the ruleset as facts. |
post_events
| No | The artifacts from the job or workflow template execution that are inserted back into the ruleset as events. |
ruleset
| No | The name of the ruleset to post the event or assert the fact to. The default is the current ruleset. |
retry
| No | If the job or workflow template fails execution, retry it once.
Takes a Boolean value of true or false
|
retries
| No | If the job or workflow template fails execution, the number of times to retry it. Takes an integer value. |
delay
| No | The time interval between retries, specified in seconds. Takes an integer value. |
var_root
| No | If the event is a deeply nested dictionary, then the var_root field can specify the key name whose value should replace the matching event value.
The var_root argument can take a dictionary to account for data when there are multiple matching events. |
job_args
| No | Additional arguments sent to the job or workflow template launch API.
Any answers to the survey and other extra variables should be set in the extra_vars nested key.
Events and facts are automatically included in extra_vars as well. |
To access event information from the ansible_eda namespace in the job or workflow template, either select the checkbox in the section of the template, or create a survey that includes the ansible_eda variable.
![]() |
Use the following steps to view audit details in Event-Driven Ansible controller.
Log in to the Event-Driven Ansible controller web UI.
Navigate to .
![]() |
The web UI displays a list of the rule audits.
Click the name of a rule audit to view details about the rulebook activation.
![]() |
The details page shows when the activation was triggered and if it was successful or not.
Click the tab to show the source event that was used.
![]() |
Click the tab to show the actions that were run.
![]() |
If the rulebook activation ran the run_job_template or run_workflow_template actions, then the URL of the action name points to the corresponding job in automation controller.
Event-Driven Ansible Controller Overview
Setting up Credentials for Event-Driven Ansible Controller
Token-based Authentication - Ansible Documentation
Setting up an Automation Controller Token
Actions - run_job_template - Ansible Documentation