Sign inSign up

michaelact/ansibila

By michaelact

•Updated almost 5 years ago

Generate documentation from Ansible roles in Markdown document.

0

209

michaelact/ansibila repository overview

⁠Ansibila.go

Fully referenced from https://github.com/terraform-docs/terraform-docs⁠ .

⁠What is Ansibila.go

Generate documentation from Ansible roles in Markdown document.

⁠Installation

Stable binaries are also available on the [releases] page. To install, download the binary for your platform from "Assets" and place this into your $PATH:

curl -Lo ./ansibila.tar.gz https://github.com/hateus/ansibila/releases/download/v0.1.0/ansibila-v0.1.0-$(uname)-amd64.tar.gz
tar -xzf ansibila.tar.gz
chmod +x Ansibila.go
mv Ansibila.go /usr/local/ansibila

⁠Usage

⁠Using docker

Ansibila can be run as a container by mounting a directory with roles directory in it and run the following command:

docker run --rm --volume "$(pwd):/ansibila" -u $(id -u) docker.io/michaelact/ansibila:latest markdown table --dirpath /ansibila/path/to/roles --varfile variables.yml --tmplpath templates

If output.file is not enabled for this module, generated output can be redirected back to a file:

docker run --rm --volume "$(pwd):/ansibila" -u $(id -u) docker.io/michaelact/ansibila:latest markdown table --dirpath /ansibila/path/to/roles --varfile variables.yml --tmplpath templates > doc.md

NOTE: Docker tag latest refers to latest stable released version and edge refers to HEAD of main at any given point in time.

⁠Content Template

Generated content can be customized further away with content in configuration. If the content is empty the default order of sections is used.

Compatible formatters for customized content are markdown.

content is a Go template with following additional variables:

  • {{ .Metadata }}
  • {{ .Modules }}
  • {{ .Variables }}
  • {{ .Playbook }}
  • {{ .License }}

These variables are the generated output of individual sections in the selected formatter. For example {{ .Variables }} is Markdown Table representation of variables.yml when formatter is set to markdown table.

⁠Click here to see an example of the documentation generated from Ansibila⁠

⁠Community

  • Discuss Ansibila.go on [Telegram]

⁠License

MIT License - Copyright (c) 2021 The hateus Author.

Tag summary

Content type

-

Digest

Size

-

Last updated

almost 5 years ago

docker pull michaelact/ansibila