Package: docsible
DocsibleAboutDocsible 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 ContentsFeaturesInstallationUsageData SourcesPrerequisitesContributingLicenseFeaturesGenerates a README in Markdown formatScans and includes default variables and role-specific variablesParses tasks, including special Ansible task types like 'block' and 'rescue'Optionally includes playbook content in the READMECLI-based, easy to integrate into a CI/CD pipelineProvides a templating feature to customize outputSupports multiple YAML files withintasks,defaults,varsdirectoryIncludes meta-data like author and license frommeta/main.[yml/yaml]Generates a well-structured table for default and role-specific variablesSupport for encrypted Ansible Vault variablesInstallationTo install Docsible, you can run:pipinstalldocsibleUsageTo use Docsible, you can run the following command in your terminal:Specific pathdocsible--role/path/to/ansible/role--playbook/path/to/playbook.yml--graphCurrent dirdocsible--graph# by default it's take tests/test.yml playbook from role if not specified anyOnly role without playbookdocsible--role/path/to/ansible/role# without include a playbook into readme$docsible--help
Usage:docsible[OPTIONS]Options:--roleTEXTPathtotheAnsibleroledirectory.--playbookTEXTPathtotheplaybookfile.--graphGenerateMermaidgraphfortasks.--no-backupDonotbackupthereadmebeforeremove.--no-docsibleDonotcreate.docsiblefileanddonotprintrelativevariabletogeneratedREADME.md.--commentsReadcommentsfromtasksfiles.--versionShowthemoduleversion.--helpShowthismessageandexit.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).--comments: Read comments from tasks files. (Optional).Data SourcesDocsible fetches information from the following files within the specified Ansible role:defaults/*.yml/yaml: For default variablesvars/*.yml/yaml: For role-specific variablesmeta/main.yml/yaml: For role metadatatasks/*.yml/yaml: For tasks, including special task types and subfoldersExamplesDemo1 coffeemaker_midday roleDemo2 coffeemaker_morning rolePrerequisitesDocsible works with Python 3.x and requires the following libraries:ClickJinja2PyYAMLTODOClean the codeAdd more featuresAbout commentsThis tool work whith several type of comments.On variables and defaultsThe tool read comments placed before a variable, only if it begin with specific tag:# title:This tag will be used for popiulate the columnTitleof the README.md. It is a short description of the variable# required:This tag will be used for popiulate the columnRequiredof the README.mdOn tasksThe tool will read all the line before each- name:of the tasks that begin with#.
All comment will be reported to the columnCommentsof the tasks tables.ContributingFor details on how to contribute, please read theContributing Guidelines.LicenseThis project is licensed under the MIT License. See theLICENSEfile for more details.AuthorLucian BLETAN