Ansible role template
$ ansible-galaxy install git+https://github.com/netr0m/ansible-role-template.git
None
Available variables are listed in docs/default-variables.md
(see defaults/main.yml
)
See ansible-requirements.yml for a list
ansible-galaxy collection install -r ansible-requirements.yml
ansible-galaxy role install -r ansible-requirements.yml
---
- name: Example Playbook
hosts: all
become: true
gather facts: true
roles:
- { role: netr0m.template }
...
This project uses pre-commit.
Currently, there are three hooks:
To run pre-commit
manually, run pre-commit run -a
To run pre-commit, you need three things:
- A virtual environment in the parent directory of this repository
$ python3 -m venv ../.venv
$ source ../.venv/bin/activate
- The Python dependencies (see requirements.txt)
$ pip install -r requirements.txt
- Pre-commit hooks installed
$ pre-commit install
This project provides a script for generating markdown files representing ansible (YAML) variable definitions.
An example can be seen in docs/default-variables.md
, which is generated from the variables defined in defaults/main.yml
.
To run the generator, issue the following command. If no parameters are specified, this will generate a markdown file based on the variables in defaults/main.yml
, and write it to docs/default-variables.md
.
$ python3 generate-vars-md.py
# Display help message
$ python3 generate-vars-md.py --help
# Specify alternative input and output paths
$ python3 generate-vars-md.py --in-file vars/debian.yml --out-file docs/debian-vars.md --title "Debian Variables"
This role was created in 2022 by netr0m