Generate documentation and continuous integration files for an Ansible Role.
Go to file
Robert de Bock 0ca1125aa8 Allow GitHub variables to be mapped. 2023-02-20 15:38:19 +01:00
.github/workflows Use checkout v3 action` 2022-06-30 10:20:59 +02:00
defaults Disable shared runners. 2022-11-01 10:42:33 +01:00
files Sweep 2023-01-03 14:50:40 +01:00
templates Allow GitHub variables to be mapped. 2023-02-20 15:38:19 +01:00
vars Better README. 2023-01-14 10:08:42 +01: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 Disable shared runners. 2022-11-01 10:42:33 +01:00
README.md Allow GitHub variables to be mapped. 2023-02-20 15:38:19 +01: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 Allow GitHub variables to be mapped. 2023-02-20 15:38:19 +01:00
get-galaxy-platforms.py Script from David, thanks! 2022-08-04 06:54:16 +02:00
github.yml Sweep 2023-01-03 14:50:40 +01:00
gitlab-delete-project.yml Sweeper. 2023-01-06 16:22:00 +01:00
gitlab-import.yml Sweeper. 2023-01-06 16:22:00 +01:00
gitlab-pipeline-trigger.yml Sweeper. 2023-01-06 16:22:00 +01:00
gitlab-public.yml Sweeper. 2023-01-09 08:50:25 +01:00
gitlab-pull-mirror.yml Use plain name instead of variable. 2023-01-27 08:53:17 +01:00
gitlab.yml Only the group runner. 2023-02-13 13:34:53 +01: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/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/preferences.yml

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

parameter type default description
tox_ansible_versions list of strings not set What versions should Tox test? (Default: all.)
github_variables_mapping list not set A list of name and variable, name refers to the GitHub exposed name, variable refers to the name you'd like to pass to molecule, tox and Ansible.

Example

---
tox_ansible_versions:
  - 7
github_variables_mapping:
  - name: secrets.VAULT_LICENSE
    variable: VAULT_LICENCE
  - name: secrets.MY_VAR
    variable: someTHING