Event-Driven Ansible

In today’s rapidly evolving digital landscape, organizations face the challenge of managing complex IT environments while striving to deliver innovative solutions. Manual tasks and repetitive operations can consume valuable time and resources, hindering teams from focusing on strategic initiatives. To address these issues, Red Hat® Ansible® Automation Platform introduces Event-Driven Ansible. This event-handling capability empowers organizations to automate time-consuming tasks and respond to changing conditions across any IT domain.

Event-Driven Ansible enables processing events containing critical intelligence about the IT environment. It intelligently determines the appropriate response to each event and executes automated actions to address or remediate them. While IT service management tasks, such as ticket enhancement, remediation, and user management, are excellent starting points, Event-Driven Ansible offers the flexibility to automate a wide range of tasks throughout the IT infrastructure.

One of the key benefits of Event-Driven Ansible is its ability to work as a powerful, unified platform for automation. Organizations can choose between manual or automatic automation styles, all within a single, cohesive platform. This versatility allows teams to work smarter and deliver IT services precisely while freeing time to focus on critical and innovative work that drives value for the business.

By leveraging event-driven automation, organizations can significantly boost their speed and responsiveness. Problems can be addressed promptly, even before they escalate into urgent issues. Mean-time-to-resolution improves, reducing the impact of incidents on operations. Furthermore, the automation of low-level tasks optimizes resource allocation, enabling valuable team members to concentrate on strategic priorities and innovation.

Event-Driven Ansible’s flexibility is a standout feature. It allows easy application of event-driven automation across diverse needs. Users can subscribe to multiple event sources and utilize YAML to write conditional rules that implement actions according to specific requirements. Moreover, Event-Driven Ansible can seamlessly integrate with existing playbooks or templates, maximizing the value of trusted automation assets.

Another advantage of Event-Driven Ansible is its adaptability across various IT domains. Organizations can automate repetitive tasks and streamline operations using a single automation platform, whether networking, edge computing, infrastructure, DevOps, security, or the cloud. This consistency ensures that team knowledge is codified in Ansible Rulebooks, guaranteeing that actions are performed consistently, minimizing human errors caused by repetitive tasks, and addressing configuration drift promptly.

Getting started with Event-Driven Ansible is made easier with interactive labs and webinars. These resources provide hands-on experience and detailed Playbooknstrations, enabling users to quickly grasp and apply the concepts effectively to their specific needs.

So, how does Event-Driven Ansible work? It connects event sources to corresponding actions through rules. Ansible Rulebooks define event sources and specify conditional instructions on responding to specific events. When an event occurs, Event-Driven Ansible identifies the corresponding rulebook, matches the event with the appropriate action, and automatically executes it. Actions can include executing existing Ansible Playbooks, templates, or modules and providing extended value from established automation practices.

To illustrate the power of Event-Driven Ansible, consider a scenario where an observability tool detects an unresponsive network router. This event triggers Event-Driven Ansible, which locates the corresponding Ansible Rulebook and matches the event with the desired action. This action could involve re-applying a configuration, resetting the router, or creating a service ticket. Event-Driven Ansible then executes the instructions from the rulebook, resetting the router and restoring normal function — without manual intervention, even during off-hours.

Ansible Rulebook CLI serves as a command-line interface for running Ansible Rulebooks. It monitors events and delegates the execution of playbooks to Ansible Automation Platform’s existing tooling. On the other hand, the Event-Driven Ansible controller provides management, scaling, and observability functionality that enables the effective utilization of Event-Driven Ansible across various environments, including the cloud, on-premise, and hybrid setups.

To further expedite event-driven automation projects, Event-Driven Ansible Content Collections offer event-source plugin code for various provided event sources, along with Ansible Rulebooks. These collections are a starting point for organizations looking to kickstart their event-driven automation initiatives.

Join 50+ hours of courses in our exclusive community

Demo

  1. Download the Installer from the ansible-automation-platform-setup-bundle-2.4–1-aarch64.tar.gz from the Red Hat Console

  2. Customize the inventory file for the Installer. For single node Automation Controller use the following file:

[automationcontroller]
ac.example.com
[automationcontroller:vars]
peers=execution_nodes
[execution_nodes]
[automationhub]
[automationedacontroller]
eda.example.com ansible_connection=local
[database]
[sso]
[all:vars]
admin_password='redhat'
pg_host=''
pg_port=5432
pg_database='awx'
pg_username='awx'
pg_password='redhat'

registry_url='registry.redhat.io'
registry_username=''
registry_password=''
receptor_listener_port=27199
automationhub_admin_password='redhat'
automationhub_pg_host=''
automationhub_pg_port=5432
automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=''
automationhub_pg_sslmode='prefer'

automationedacontroller_admin_password='redhat'
automationedacontroller_pg_host='ac.example.com'
automationedacontroller_pg_port=5432
automationedacontroller_pg_database='automationedacontroller'
automationedacontroller_pg_username='automationedacontroller'
automationedacontroller_pg_password='redhat'
sso_keystore_password=''
sso_console_admin_password=''
  1. Execute the setup.sh

You might would like to customize the collections/ansible_collections/ansible/automation_platform_installer/roles/preflight/defaults/main.yml file in a development environment to lower the 7400 MB of memory requirements.

  1. Connect to the WebUI and Login with the admin user and the selected password (“redhat”):

Ansible Automation Platform 2.4 Event-Driven Ansible Controller WebUI

  1. The main dashboard look like the following

Ansible Automation Platform 2.4 Event-Driven Ansible Controller WebUI

Conclusion

In conclusion, Event-Driven Ansible empowers organizations to automate time-consuming tasks, enhance IT operations, and free up teams to focus on innovation. By leveraging event-driven automation, organizations can boost efficiency, address issues promptly, and ensure consistent and reliable operations. With a unified automation platform and a wide range of capabilities, Event-Driven Ansible is a valuable tool for organizations seeking to streamline their IT processes and deliver greater value to their business.

Subscribe to the YouTube channel, Medium, and Website, X (formerly Twitter) to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my Udemy 300+ Lessons Video Course.

BUY the Complete Udemy 300+ Lessons Video Course

My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps

BUY the Complete PDF BOOK to easily Copy and Paste the 250+ Ansible code

Want to keep this project going? Please donate

Patreon Buy me a Pizza