Generate documentation and continuous integration files for an Ansible Role.
Go to file
Robert de Bock e996f5f87a Bump version of molecule action, update tox to use py38 and fix "path". 2020-05-20 15:34:23 +02:00
files Typo. 2020-04-29 14:37:52 +02:00
templates Bump version of molecule action, update tox to use py38 and fix "path". 2020-05-20 15:34:23 +02:00
vars Trusty is too old. 2020-05-19 10:38:59 +02:00
.gitignore New Slack stuff. 2020-05-19 18:57:48 +02:00
README.md New Slack stuff. 2020-05-19 18:57:48 +02:00
ansible.cfg New Slack stuff. 2020-05-19 18:57:48 +02:00
cd 33 is now Rawhide. 2020-05-12 07:14:24 +02:00
generate.yml New Slack stuff. 2020-05-19 18:57:48 +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/exception.yml
  • meta/preferences.yml
  • defaults/main.yml
  • requirements.yml
  • molecule/default/prepare.yml
  • molecule/default/playbook.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/"

secure.yml

This file contains a secret unique to you; te slack encryption token. You have to create this file yourself and it should contain:

---
slack_token: "YOUR_SLACK_USERNAME:YOUR_SLACK_TOKEN"

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/exception.yml

This optional file describes why some build are excepted.

---
exceptions:
  - variation: alpine
    reason: "Not idempotent"

meta/preferences.yml

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

---
travis_parallel: no
tox_versions:
  - current