Code Monkey home page Code Monkey logo

molecule's Introduction

Molecule

Molecule

PyPI Package Documentation Status Build Status Requirements 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 to manage virtual machines, with support for multiple Vagrant providers (currently VirtualBox, Parallels and VMware Fusion). Molecule supports Serverspec or Testinfra to run tests. Molecule uses an Ansible playbook (playbook.yml), to execute the role and its tests.

Quick Start

Install molecule using pip:

$ pip install molecule

Create a new role:

$ molecule init foo
Successfully initialized new role in ./foo/

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

$ cd foo
$ molecule test
==> vagrant-01: VM not created. Moving on...
==> vagrant-01: VM not created. Moving on...
Bringing machine 'vagrant-01' up with 'virtualbox' provider...
==> vagrant-01: Importing base box 'hashicorp/precise64'...
...
==> vagrant-01: Machine not provisioned because `--no-provision` is specified.

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

GATHERING FACTS ***************************************************************

ok: [vagrant-01]

TASK: [foo | install curl] ****************************************************

changed: [vagrant-01]

PLAY RECAP ********************************************************************
vagrant-01                 : ok=2    changed=1    unreachable=0    failed=0

Idempotence test in progress... OKAY
Inspecting 2 files
..

2 files inspected, no offenses detected
/Users/jodewey/.rvm/rubies/ruby-2.2.0/bin/ruby -I/Users/jodewey/.rvm/gems/ruby-2.2.0/gems/rspec-support-3.3.0/lib:/Users/jodewey/.rvm/gems/ruby-2.2.0/gems/rspec-core-3.3.2/lib /Users/jodewey/.rvm/gems/ruby-2.2.0/gems/rspec-core-3.3.2/exe/rspec --pattern spec/\*_spec.rb,spec/vagrant-01/\*_spec.rb,spec/hosts/vagrant-01/\*_spec.rb,spec/group_1/\*_spec.rb,spec/groups/group_1/\*_spec.rb,spec/group_2/\*_spec.rb,spec/groups/group_2/\*_spec.rb

Package Installation
  Package "curl"
    should be installed

Finished in 0.40244 seconds (files took 0.90459 seconds to load)
1 example, 0 failures

==> vagrant-01: Attempting graceful shutdown of VM...
==> vagrant-01: Destroying VM and associated drives...

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

0xdec0de avatar alop avatar bborysenko avatar cimarron-pistoncloud avatar davidwittman avatar dhutty avatar retr0h avatar rgreinho avatar schlueter avatar srisakha avatar tiewei avatar timgclark avatar

Watchers

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