Skip to main content

Document generator for ansible role

Project description

Docsible

About

Docsible is a command-line interface (CLI) written in Python that automates the documentation of Ansible roles. It generates a Markdown-formatted README file for role by scanning the Ansible YAML files.

Table of Contents

Features

  • Generates a README in Markdown format
  • Scans and includes default variables and role-specific variables
  • Parses tasks, including special Ansible task types like 'block' and 'rescue'
  • Optionally includes playbook content in the README
  • CLI-based, easy to integrate into a CI/CD pipeline
  • Provides a templating feature to customize output
  • Supports multiple YAML files within tasks, defaults, vars directory
  • Includes meta-data like author and license from meta/main.yml
  • Generates a well-structured table for default and role-specific variables
  • Support for encrypted Ansible Vault variables

Installation

To install Docsible, you can run:

pip install docsible

Usage

To use Docsible, you can run the following command in your terminal:

docsible --role /path/to/ansible/role --playbook /path/to/playbook.yml
docsible --role /path/to/ansible/role # without include a playbook into readme
$ docsible --help
Usage: docsible [OPTIONS]

Options:
  --role TEXT      Path to the Ansible role directory.
  --playbook TEXT  Path to the playbook file.
  --graph          Generate Mermaid graph for tasks.
  --no-backup      Don't backup the readme before remove.
  --help           Show this message and exit.

Flags

  • --role: Specifies the directory path to the Ansible role.
  • --playbook: Specifies the path to the Ansible playbook (Optional).
  • --graph: Generate mermaid for role and playbook.
  • --no-backup: Ignore existent README.md and remove before generate a new one. (Optional).

Data Sources

Docsible fetches information from the following files within the specified Ansible role:

  • defaults/*.yml: For default variables
  • vars/*.yml: For role-specific variables
  • meta/main.yml: For role metadata
  • tasks/*.yml: For tasks, including special task types and subfolders

Prerequisites

Docsible works with Python 3.x and requires the following libraries:

  • Click
  • Jinja2
  • PyYAML

Contributing

For details on how to contribute, please read the Contributing Guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docsible-0.4.11.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

docsible-0.4.11-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file docsible-0.4.11.tar.gz.

File metadata

  • Download URL: docsible-0.4.11.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-36-generic

File hashes

Hashes for docsible-0.4.11.tar.gz
Algorithm Hash digest
SHA256 a8b81231dd33ff407530898d30fc2cde85616b6d38e9720c7d721652f0452f11
MD5 98ecd72b008dc2946494c3acd9471a8e
BLAKE2b-256 942d5d0e0a80cfb8451f8fde8c2b2c040b37d7227db8c726dabb97235914a534

See more details on using hashes here.

File details

Details for the file docsible-0.4.11-py3-none-any.whl.

File metadata

  • Download URL: docsible-0.4.11-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-36-generic

File hashes

Hashes for docsible-0.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ce8438fdf0ef30bbe680f532371ee0942865b004334a91d83c3ab0b7630e1e
MD5 fbfa30c818a80c71d4b58d8dac06da56
BLAKE2b-256 4e6bf6bac736a558fd327f255a1910e18021be2288419aa2ed5658abad312072

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page