Generate documentation and continuous integration files for an Ansible Role.
Go to file
Robert de Bock 4e9357f193 Prepare for ansible-lint-6.3.0 2022-06-30 10:23:04 +02:00
.github/workflows Use checkout v3 action` 2022-06-30 10:20:59 +02:00
files Update pre-commit component versions. 2022-06-30 10:22:04 +02:00
templates Prepare for ansible-lint-6.3.0 2022-06-30 10:23:04 +02:00
vars Prepare for ansible-lint-6.3.0 2022-06-30 10:23:04 +02:00
.gitignore New Slack stuff. 2020-05-19 18:57:48 +02:00
.yamllint Fix a few yaml issues. 2021-09-15 10:41:20 +02:00
LICENSE Add a license. 2021-09-15 10:24:00 +02:00
README-gitlab.md How to set schedules for GitLab. 2021-05-04 13:30:34 +02:00
README.md New feature in action. 2022-03-29 10:24:06 +02:00
ansible.cfg Add 2 enterprise-grade pre-commit hooks. 2021-01-05 15:47:21 +01:00
community.general.sh Add a simple script to add community.general to a role. 2021-09-20 09:23:41 +02:00
generate.yml Cleanup. 2022-05-10 13:37:55 +02:00
gitlab.yml Enable variable. 2021-04-02 20:07:38 +02:00
indexer.sh Add a license. 2021-09-15 10:24:00 +02:00

README.md

ansible-generator

Generate documentation and continuous integration files for an Ansible Role.

Input

This script loads input from:

  • meta/main.yml*
  • meta/version.yml
  • meta/preferences.yml
  • defaults/main.yml
  • requirements.yml
  • molecule/default/prepare.yml
  • molecule/default/converge.yml*
  • molecule/default/verify.yml
  • generate_modules.sh
  • secure.yml
  • Ansible Galaxy

(Items with a star are mandatory)

Output

This script writes output to:

  • README.md
  • molecule/default/molecule.yml
  • CONTRIBUTING.md
  • SECURITY.md
  • LICENSE
  • .travis.yml
  • tox.ini
  • .ansible-lint*
  • .github/workflows/ansible.yml
  • .github/workflows/galaxy.yml

Usage

cd ansible-role-my_role
../path/to/generate.yml

Configuration

In vars/main.yml you can change these variable to customize the output.

---
# Settings to Docker containers.
docker_namespace: robertdebock
docker_image: fedora
docker_tag: latest

# References to travis use a namespace, this is likely your username on Travis.
travis_namespace: robertdebock

# Documentation refers to Ansible Galaxy. this is likely your username on Galaxy.
galaxy_namespace: robertdebock

# Your username/organization name on GitHub.
github_namespace: robertdebock

# Your name and optionally email-address.
author: Robert de Bock (robert@meinit.nl)

# The full URL to your website.
author_website: "https://robertdebock.nl/"

meta/version.yml

This optional file can be placed when a role contains a version.

---
project_name: Ansible
reference: "defaults/main.yml"
versions:
  - name: ansible
    url: "https://github.com/ansible/ansible/releases"

meta/preferences.yml

This optional file describes how Travis, Tox and Molecule should behave.

parameter type default description
tox_version list of strings not set What versions should Tox test? (Default: all.)
enterprise_linux string not set If EL is used in meta/main.yml where should tests happen on? (Default: rockylinux.)
---
tox_versions:
  - current
enterprise_linx: centos