Giter Club home page Giter Club logo

ansible-role-skeleton's Introduction

Ansible Role Skeleton

A Skeleton for Ansible role development.

Making sure all roles have a consistent template that eases development.

Conventions

An explanation of conventions used in roles can be found in the docs.

Requirements

Installation

Install from GitHub

git clone https://github.com/llamalump/ansible-role-skeleton.git

Usage

Install Ansible

The recommended and portable way to install Ansible is via virtualenv.

# Create a new virtualenv
virtualenv $env_name
# Activate virtualenv
source $env_name/bin/activate
# Install Ansible
pip install ansible

Configure Ansible

Ansible configuration can be done in multiple files, depending on your needs by configuring your ansible.cfg file.

You have to add the following lines to your ansible.cfg:

[galaxy]
role_skeleton = <path to git repo for ansible-skeleton>/role
skeleton_ignore = ^.git$,^.*/.git_keep$

Install Molecule

Molecule must be installed in the same virtualenv (see above).

# Activate virtualenv
source $env_name/bin/activate
# Install molecule and docker support
pip install molecule

Create Ansible Role

To ensure you are developing and testing your role for Ansible Galaxy, some manual steps are required for a fresh role:

# Create Directory from skeleton
ansible-galaxy init $role_name
mv $role_name <github username>.$role_name

Add Tests to the role

Testing is an important part of creating a new role, and good practice for updating existing ones. Details on this can be found in Ansible Tests

License

MIT

Author

ansible-role-skeleton's People

Contributors

kirikae avatar rst-ack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.