This repository contains different skeletons / blueprints to kickstart the creation of new roles and collections.
- Clone this repository:
git clone https://github.com/foundata/ansible-skeletons.git
- Call
ansible-galaxy
and provide the path to the skeleton to use as well as a role name:ansible-galaxy role init --role-skeleton "./ansible-skeletons/role_default" "name_of_your_role"
name_of_your_role
has to follow some rules and should consist ofa-z
,0-9
and_
only.- Adapt the
--role-skeleton
parameter value if you want to use another skeleton thanrole_default
. You can find a description of the available ones below.
- Have a look at the created
./name_of_your_role/FIXME.md
to get further instructions.
The following lists gives an overview over the available skeletons. You can also have a look into the sub-directories of this repository to look at their code (even though the source might be partially hard to read. There is Jinja code which will be processed by ansible-galaxy role init
to get the final files).
A general purpose skeleton to create new Ansible Galaxy roles. Main features:
- Init tasks to check the execution environment (e.g. minimum Ansible version and supported operating systems), based on the role's meta data.
- Easy management of role parameters and belonging
assert
rules for validation (see{{ role_name }}_required_vars
inrole_default/vars/main.yml.j2
for more information). - Separation of logical task groups.
The skeletons should be compatible with ansible-galaxy
from ansible-core
version 2.9 and newer. It was tested with:
ansible-galaxy [core 2.14.8]
ansible-galaxy [core 2.9.13]
See CONTRIBUTING.md
if you want to get involved.
This project's functionality is mature, so there might be little activity on the repository in the future. Don't get fooled by this, the project is under active maintenance and used on daily basis by the maintainers.
Apache License 2.0 if not mentioned otherwise. See LICENSE
and NOTICE
for details.
This project was created and is maintained by (alphabetical order):
If you like it, you might buy us a coffee.