Giter Site home page Giter Site logo

holmser / molecule Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ansible/molecule

0.0 1.0 0.0 7.69 MB

Automated testing for Ansible roles

Home Page: http://molecule.readthedocs.org

License: MIT License

Shell 1.31% Python 98.33% Ruby 0.36%

molecule's Introduction

Molecule

PyPI Package Documentation Status

Molecule is designed to aid in the development and testing of Ansible roles including support for multiple instances, operating system distributions, virtualization providers and test frameworks.

It leverages Vagrant, Docker, and OpenStack to manage virtual machines/containers, with support for multiple Vagrant providers (currently VirtualBox, Parallels, VMware Fusion, and Libvirt). Molecule supports Serverspec, Testinfra, or Goss (beta) to run tests. Molecule uses an Ansible playbook (playbook.yml), to execute the role and its tests.

Ansible Support

  • 1.9.6 - Limited (Docker driver not-supported by Ansible)
  • 2.0.2.0 - Supported
  • 2.1.1.0 - Supported

Dependencies

Molecule relies on several outside packages and programs to function.

Verifier

Driver

Provider

Quick Start

Important

Ansible and the driver's python package require installation.

Install molecule using pip:

$ pip install ansible
$ pip install docker-py
$ pip install molecule

Create a new role with the docker driver:

$ molecule init --role foo --driver docker
--> Initializing role foo...
Successfully initialized new role in ./foo

Or add molecule to an existing role:

$ cd foo
$ molecule init --driver docker
--> Initializing molecule in current directory...
Successfully initialized new role in /private/tmp

Update the role with needed functionality and tests. Now test it:

$ cd foo
$ molecule test
--> Destroying instances ...
--> Checking playbooks syntax ...

playbook: playbook.yml
--> Creating instances ...
--> Creating Ansible compatible image of ubuntu:latest ...
--> Creating Ansible compatible image of ubuntu:latest ...
Creating container foo-01 with base image ubuntu:latest ...
Container created.
Creating container foo-02 with base image ubuntu:latest ...
Container created.
--> Starting Ansible Run ...

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [foo-01]
ok: [foo-02]

PLAY RECAP *********************************************************************
foo-01                     : ok=1    changed=0    unreachable=0    failed=0
foo-02                     : ok=1    changed=0    unreachable=0    failed=0

--> Idempotence test in progress (can take a few minutes)...
--> Starting Ansible Run ...
Idempotence test passed.
--> Executing ansible-lint.
--> Executing flake8 on \*.py files found in tests/.
--> Executing testinfra tests found in tests/.
============================= test session starts ==============================
platform darwin -- Python 2.7.11, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /private/tmp/foo/tests, inifile:
plugins: xdist-1.14, testinfra-1.4.1
collected 2 itemss

tests/test_default.py ..

=========================== 2 passed in 1.52 seconds ===========================
--> Destroying instances ...
Stopping container foo-01 ...
Removed container foo-01.
Stopping container foo-02 ...
Removed container foo-02.

Documentation

http://molecule.readthedocs.org/en/latest/

License

MIT

The logo is licensed under the Creative Commons NoDerivatives 4.0 License. If you have some other use in mind, contact us.

molecule's People

Contributors

retr0h avatar rgreinho avatar dhutty avatar kireledan avatar bborysenko avatar alop avatar signed8bit avatar 0xdec0de avatar timgclark avatar sebinjohn avatar oserde avatar srisakha avatar milosgajdos avatar charlieb00 avatar cimarron-pistoncloud avatar davidwittman avatar dbryant4 avatar lewg avatar kernelpanek-segfault avatar rjfellman avatar schlueter avatar tiewei avatar

Watchers

James Cloos 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.