Analyzing Ansible runs using ARA

Analyzing Ansible runs using ARA

The Ansible Run Analysis tool integrates seamlessly with Ansible, offering a simple, intuitive way to find the data you need.

human head, brain outlined with computer hardware background
Image by : 

opensource.com

x

Get the newsletter

Join the 85,000 open source advocates who receive our giveaway alerts and article roundups.

Ansible is a versatile platform that has become popular for managing servers and server configurations. Today, Ansible is used heavily to deploy and test through continuous integration (CI).

In the world of automated continuous integration, it’s not uncommon to have hundreds, if not thousands, of jobs running every day for testing, building, compiling, deploying, and more.

The Ansible Run Analysis (ARA) tool

Ansible runs generate a large amount of console data, and keeping up with high volumes of Ansible output in the context of CI is challenging. The Ansible Run Analysis (ARA) tool makes this verbose output readable and more representative of the job status and debug information. ARA organizes recorded playbook data so you can search and find what you’re interested in as quickly and as easily as possible.

Note that ARA doesn't run your playbooks for you; rather, it integrates with Ansible as a callback plugin wherever it is. A callback plugin enables adding new behaviors to Ansible when responding to events. It can perform custom actions in response to Ansible events such as a play starting or a task completing on a host.

Compared to AWX and Tower, which are tools that control the entire workflow, with features like inventory management, playbook execution, editing features, and more, the scope of ARA is comparatively narrow: It records data and provides an intuitive interface. It is a relatively simple application that is easy to install and configure.

Installation

There are two ways to install ARA on your system:

  • Using the Ansible role hosted on your GitHub account. Clone the repo and do:
ansible-playbook Playbook.yml

If the playbook run is successful, you will get:

TASK [ara : Display ara UI URL] ************************
   ok: [localhost] => {}
   "msg": "Access playbook records at http://YOUR_IP:9191"

Note: It picks the IP address from ansible_default_ipv4 fact gathered by Ansible. If there is no such fact gathered, replace it with your IP in main.yml file in the roles/ara/tasks/ folder.

  • ARA is an open source project available on GitHub under the Apache v2 license. Installation instructions are in the Quickstart chapter. The documentation and FAQs are available on readthedocs.io.

What can ARA do?

The image below shows the ARA landing page launched from the browser:


ara_landing_page.png

ara landing page

The ARA landing page

It provides summaries of task results per host or per playbook:

task_summaries.png

task summaries

ARA displays task summaries

It allows you to filter task results by playbook, play, host, task, or status:

playbook_filtered_by_hosts.png

playbook runs filtered by hosts

Playbook runs, filtered by host

With ARA, you can easily drill down from the summary view to find the results you’re interested in, whether it’s a particular host or a specific task:

summary_of_each_task.png

summary of each task

A detailed summary of each task

ARA supports recording and viewing multiple runs in the same database.

showing_gathered_facts.png

show gathered facts

Displaying gathered facts

Wrapping up

ARA is a useful resource that has helped me get more out of Ansible run logs and outputs. I highly recommend it to all Ansible ninjas out there.

Feel free to share this, and please let me know about your experience using ARA in the comments.



[See our related story, Tips for success when getting started with Ansible.]

Topics

About the author

Ajinkya Bapat -