All Projects → haidaraM → Ansible Playbook Grapher

haidaraM / Ansible Playbook Grapher

Licence: mit
A command line tool to create a graph representing your Ansible playbook tasks and roles

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ansible Playbook Grapher

Graylog Ansible Role
Ansible role which installs and configures Graylog
Stars: ✭ 173 (-26.07%)
Mutual labels:  ansible, ansible-role, ansible-playbook, playbook
Ansible Restic
Deploy restic backup program
Stars: ✭ 29 (-87.61%)
Mutual labels:  ansible, ansible-role, ansible-playbook
Upcloud Ansible
Dynamic inventory and modules for managing servers via UpCloud's API
Stars: ✭ 50 (-78.63%)
Mutual labels:  ansible, ansible-playbook, playbook
Nagios Nrpe Server
Nagios NRPE Server Role for Ansible
Stars: ✭ 27 (-88.46%)
Mutual labels:  ansible, ansible-role, ansible-playbook
Terraform Null Ansible
Terraform Module to run ansible playbooks
Stars: ✭ 114 (-51.28%)
Mutual labels:  ansible, ansible-playbook, playbook
Ansible In Action
Ansible playbook to deploy your Laravel code base to VPS
Stars: ✭ 61 (-73.93%)
Mutual labels:  ansible, ansible-role, ansible-playbook
Centos7 Cis
Ansible CentOS 7 - CIS Benchmark Hardening Script
Stars: ✭ 64 (-72.65%)
Mutual labels:  ansible, ansible-role, ansible-playbook
Ansible Role K3s
Ansible role for installing k3s as either a standalone server or HA cluster.
Stars: ✭ 132 (-43.59%)
Mutual labels:  ansible, ansible-role, playbook
Matrix Docker Ansible Deploy
Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
Stars: ✭ 2,541 (+985.9%)
Mutual labels:  ansible-role, ansible-playbook
Terrible
An Ansible playbook that apply the principle of the Infrastructure as Code on a QEMU/KVM environment.
Stars: ✭ 161 (-31.2%)
Mutual labels:  ansible, playbook
Rollback
Ansible role to rollback scripting applications like PHP, Python, Ruby, etc. in a capistrano style
Stars: ✭ 230 (-1.71%)
Mutual labels:  ansible, playbook
Ansible Nomad
⌚️ Ansible role for Nomad
Stars: ✭ 157 (-32.91%)
Mutual labels:  ansible, ansible-role
Nginx
A fairly flexible and feature full Ansible role for the NGINX web server.
Stars: ✭ 151 (-35.47%)
Mutual labels:  ansible, ansible-role
Shiva
An Ansible playbook to provision a host for penetration testing and CTF challenges
Stars: ✭ 220 (-5.98%)
Mutual labels:  ansible, ansible-playbook
Ansibleplaybooks
A collection of Ansible Playbooks that configure Kali to use Fish & install a number of tools
Stars: ✭ 143 (-38.89%)
Mutual labels:  ansible, ansible-playbook
Dellemc Openmanage Ansible Modules
Dell EMC OpenManage Ansible Modules
Stars: ✭ 169 (-27.78%)
Mutual labels:  ansible, ansible-playbook
Nci Ansible Ui
Simple web interface for running Ansible playbooks
Stars: ✭ 217 (-7.26%)
Mutual labels:  ansible, playbook
Redfish Ansible Module
Ansible modules for Out-Of-Band Controllers using Redfish APIs
Stars: ✭ 139 (-40.6%)
Mutual labels:  ansible, playbook
Ansible Relayor
An Ansible Role for Tor Relay Operators
Stars: ✭ 165 (-29.49%)
Mutual labels:  ansible, ansible-role
Ansible Role Awx
Ansible Role - AWX
Stars: ✭ 228 (-2.56%)
Mutual labels:  ansible, ansible-role

Ansible Playbook Grapher

Testing PyPI version Coverage Status

ansible-playbook-grapher is a command line tool to create a graph representing your Ansible playbook tasks and roles. The aim of this project is to quickly have an overview of your playbook.

Inspired by Ansible Inventory Grapher.

Prerequisites

  • Python 3
  • Ansible >= 2.8: If you still use an older version of Ansible, create a virtual environment and install ansible-playbook-grapher. pip will install a version of Ansible >= 2.8 if not already installed. I try to respect Red Hat Ansible Engine Life Cycle for the supported Ansible version.
  • Graphviz: The tool used to generate the graph in SVG.
    $ sudo apt-get install graphviz # or yum install or brew install
    

Installation

$ pip install ansible-playbook-grapher

Usage

$ ansible-playbook-grapher tests/fixtures/example.yml

Example

$ ansible-playbook-grapher --include-role-tasks  tests/fixtures/with_roles.yml

Example

Some options are available:

$ ansible-playbook-grapher --help
usage: ansible-playbook-grapher [-h] [-v] [-i INVENTORY]
                                [--include-role-tasks] [-s]
                                [-o OUTPUT_FILENAME] [--version] [-t TAGS]
                                [--skip-tags SKIP_TAGS] [--vault-id VAULT_IDS]
                                [--ask-vault-pass | --vault-password-file VAULT_PASSWORD_FILES]
                                [-e EXTRA_VARS]
                                playbook

Make graphs from your Ansible Playbooks.

positional arguments:
  playbook              Playbook to graph

optional arguments:
  --ask-vault-pass      ask for vault password
  --include-role-tasks  Include the tasks of the role in the graph.
  --skip-tags SKIP_TAGS
                        only run plays and tasks whose tags do not match these
                        values
  --vault-id VAULT_IDS  the vault identity to use
  --vault-password-file VAULT_PASSWORD_FILES
                        vault password file
  --version             show program's version number and exit
  -e EXTRA_VARS, --extra-vars EXTRA_VARS
                        set additional variables as key=value or YAML/JSON, if
                        filename prepend with @
  -h, --help            show this help message and exit
  -i INVENTORY, --inventory INVENTORY
                        specify inventory host path or comma separated host
                        list.
  -o OUTPUT_FILENAME, --ouput-file-name OUTPUT_FILENAME
                        Output filename without the '.svg' extension. Default:
                        <playbook>.svg
  -s, --save-dot-file   Save the dot file used to generate the graph.
  -t TAGS, --tags TAGS  only run plays and tasks tagged with these values
  -v, --verbose         verbose mode (-vvv for more, -vvvv to enable
                        connection debugging)

Configuration: ansible.cfg

The content of ansible.cfg is loaded automatically when running the grapher according to Ansible's behavior. The corresponding environment variables are also loaded.

The values in the config file (and their corresponding environment variables) may affect the behavior of the grapher. For example TAGS_RUN and TAGS_SKIP or vault configuration.

More information here.

Contribution

Contributions are welcome. Feel free to contribute by creating an issue or submitting a PR 😃

Dev environment

To setup a new development environment :

  • Install graphviz sudo apt-get install graphviz # or yum install or brew install graphviz
  • (cd tests && pip install -r requirements_tests.txt)

Run the tests with:

$ make test # run all tests

The graphs are generated in the folder tests/generated_svg. They are also generated as artefacts in Github Actions. Feel free to look at them when submitting PRs.

TODO

  • Graphviz : properly rank the edge of the graph to represent the order of the execution of the tasks and roles
  • Graphviz : find a way to avoid or reduce edges overlapping
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].