A command line tool to generate visual graphs of Ansible playbook structures for documentation and analysis.
Ansible Playbook Grapher is a Python command-line tool that generates visual graphs from Ansible playbooks. It statically analyzes playbook YAML files to create diagrams showing the relationships between plays, tasks, roles, and blocks, helping users visualize and document their automation workflows.
Ansible developers, DevOps engineers, and infrastructure teams who need to understand, document, or troubleshoot complex playbook structures, especially in large codebases with multiple roles and dependencies.
It provides a unique visual documentation layer for Ansible playbooks that static YAML files lack, with interactive features for exploration and multiple output formats for integration into documentation systems.
A command line tool to create a graph representing your Ansible playbook tasks and roles
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
SVG output supports click-to-highlight related nodes and double-click to open source files in editors like VSCode, enabling deep navigation without code execution. This is detailed in the Features section with examples for --open-protocol-handler.
Generates graphs in Graphviz (SVG), Mermaid flowchart, and JSON formats, allowing integration into documentation or custom tools. The README's comparison table shows each renderer's strengths, such as Mermaid for Markdown embedding.
Handles Ansible-specific constructs like import/include statements, variable interpolation, tags, and blocks, ensuring compatibility with complex playbooks. The Features list notes support for filters and variable interpolation when possible.
Parses playbooks without executing tasks, providing a risk-free way to understand and document workflows. The Philosophy section emphasizes this as a core benefit for documentation and analysis.
Cannot fully interpolate variables or handle dynamic includes that depend on runtime data, limiting accuracy for playbooks with heavy conditionals. The Limitations section admits tasks may not appear in the graph for such cases.
Requires Graphviz installation for SVG output, and the tool acknowledges that Graphviz may display tasks in wrong order or have overlapping labels, affecting readability. This is explicitly stated in the Limitations and notes.
Needs Python 3.10+ and a virtual environment to avoid conflicts with Ansible versions, adding complexity for quick adoption. The Prerequisites section warns about dependency issues and recommends a virtual environment.