Skip to content

foundata/ansible-skeletons

Repository files navigation

Ansible (Galaxy) Skeletons

This repository contains different skeletons / blueprints to kickstart the creation of new roles and collections.

Table of contents

Usage

  1. Clone this repository:
    git clone https://github.com/foundata/ansible-skeletons.git
  2. 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 of a-z, 0-9 and _ only.
    • Adapt the --role-skeleton parameter value if you want to use another skeleton than role_default. You can find a description of the available ones below.
  3. Have a look at the created ./name_of_your_role/FIXME.md to get further instructions.

Description of provided skeletons

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).

role_default

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 in role_default/vars/main.yml.j2 for more information).
  • Separation of logical task groups.

Compatibility

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]

Contributing

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.

License, Copyright

Apache License 2.0 if not mentioned otherwise. See LICENSE and NOTICE for details.

Author information

This project was created and is maintained by (alphabetical order):

If you like it, you might buy us a coffee.

About

Different Ansible blueprints for ansible-galaxy role init --role-skeleton "./ansible-skeletons/role_default" "name_of_your_role"

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published