TranslateProject/sources/tech/20180510 Analyzing Ansible runs using ARA.md
2018-05-14 13:00:02 +08:00

5.3 KiB
Raw Blame History

Analyzing Ansible runs using ARA

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, its 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 youre 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

The ARA landing page

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

task summaries

ARA displays task summaries

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

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 youre interested in, whether its a particular host or a specific task:

summary of each task

A detailed summary of each task

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

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.]


via: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara

作者:Ajinkya Bapat 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出