This repository contains different skeletons / blueprints to kickstart the creation of new roles and collections.
They follow several guidelines and best practices:
- foundata: Ansible style guide
- Red Hat's Coding Style Good Practices for Ansible and
- Best Practices of the Ansible User guide
- 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.
Copyright (c) 2020, 2023-2025 foundata GmbH (https://foundata.com)
This project is licensed under the GNU General Public License v3.0 or later (SPDX-License-Identifier: GPL-3.0-or-later
), see LICENSES/GPL-3.0-or-later.txt
for the full text.
The REUSE.toml
file provides detailed licensing and copyright information in a human- and machine-readable format. This includes parts that may be subject to different licensing or usage terms, such as third-party components. The repository conforms to the REUSE specification. You can use reuse spdx
to create a SPDX software bill of materials (SBOM).
This project was created and is maintained by the following foundata employees (alphabetical order):
If you like it, you might buy us a coffee.