Metadata-Version: 2.3
Name: ansible-analyzer
Version: 0.1.2
Summary: CLI for Ansible role & playbook analysis & visualization
Author: Valentine Shatravenko
Author-email: Valentine Shatravenko <vshatravenko@gmail.com>
Requires-Dist: pydot>=4.0.1
Requires-Dist: pyyaml>=6.0.3
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Ansible Analyzer

`ansible-analyzer` lets you visualize one or all playbooks from your
project by building a graph representation of each playbook and role task
included.

## Requirements

You need to install the `graphviz` OS package in order to use this CLI:

* macOS - `brew install graphviz`
* Debian/Ubuntu - `apt install graphviz`
* Fedora - `dnf install graphviz`
* Arch Linux - `pacman -Sy graphviz`

## Usage

To analyze a specific playbook, run:

```sh
ansible-analyzer playbook -r *roles_dir* -f *playbook_path* -o *output_path*
```

where

* `-r` is for the local directory containing roles
* `-f` is for the playbook file path
* `-o` (optional) is for the graph `.png` output path

To analyze all the playbooks in a given directory, run:

```sh
ansible-analyzer all -r *roles_dir* -d *playbooks_dir* -o *output_path*
```

where

* `-r` is for the local directory containing roles
* `-d` is for the local directory containing playbooks to be analyzed
* `-o` (optional) is for the graph `.png` output path

Finally, the CLI will save a `.png` file containing a graph representation
of your project similar to the following:
![example graph](https://github.com/vshatravenko/ansible-analyzer/blob/main/example_graph.png)

To print role & task statistics, use `-s`.
To disable graph output, use `--no-out`.
