Giter Club home page Giter Club logo

cookiecutter-ansible-role-molecule's Introduction

Build Status

Cookiecutter template for ansible roles

Template for ansible role with molecule testing

Requirements

The template itself only needs python, cookicuter and pre-commit. Install them doing pip install cookiecutter pre-commit

What this template provides?

  • Initialize a new git repo in the local machine
  • Add .yamllint config file (used by molecule)
  • Add .pre-commit-config.yaml used by pre-commit
  • Add .gitignore with common files I don't want to track in git
  • Add configuration for Molecule in the "molecule" folder
    • default molecule scenario runs on docker + centos7/systemd image
    • There is another molecule scenario using Vagrant + bento/centos-7 box (1 core - 1GB ram - selinux=permissive)
    • molecule runs testinfra in verbose mode
    • the role is executed with become: true (everything is executed as root/sudo)
  • Add a travis or Gitlab-CI config file (Optional. By default it's not added)
  • And probably something else that I forget... :)

Usage

To initialize the role with cookiecuter

$ pip install cookiecutter pre-commit
$ cookiecutter gh:pescobar/cookiecutter-ansible-role-molecule

To initialize the role with molecule

$ pip install molecule pre-commit
$ molecule init template --url https://github.com/pescobar/cookiecutter-ansible-role-molecule

To test the default scenario docker + centos7/systemd image

$ molecule test

To test the scenario with vagrant + centos7

$ molecule test -s vagrant

Directory structure

role_name/
├── defaults
│   └── main.yml
├── .gitignore
├── .gitlab-ci.yml
├── handlers
│   └── main.yml
├── meta
│   └── main.yml
├── molecule
│   ├── default
│   │   ├── Dockerfile.j2
│   │   ├── INSTALL.rst
│   │   ├── molecule.yml
│   │   └── playbook.yml
│   ├── tests
│   │   └── test_default.py
│   └── vagrant
│       ├── INSTALL.rst
│       ├── molecule.yml
│       ├── playbook.yml
│       └── prepare.yml
├── .pre-commit-config.yaml
├── README.md
├── tasks
│   └── main.yml
├── .travis.yml
├── vars
│   └── main.yml
└── .yamllint

cookiecutter-ansible-role-molecule's People

Contributors

pescobar avatar

Watchers

 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.