Giter Site home page Giter Site logo

molecule-ec2's Introduction

Molecule EC2 Plugin

PyPI Package Python Black Code Style Ansible Code of Conduct Ansible mailing lists Repository License

Molecule EC2 is designed to allow use of AWS EC2 for provisioning of test resources.

Quickstart

Installation

pip install molecule-ec2

Create a scenario

With a new role

molecule init role -d ec2 my-role

This will create a new folder my-role containing a bare-bone generated role like you would do with ansible-galaxy init command. It will also contain a molecule folder with a default scenario using the ec2 driver (using ansible community.aws.ec2_instance collection). Install the collection using ansible-galaxy install -r test_requirements.yml.

In a pre-existing role

molecule init scenario -d ec2

This will create a default scenario with the ec2 driver in a molecule folder, located in the current working directory.

Example

This is a molecule.yml example file

dependency:
   name: galaxy
driver:
   name: ec2
platforms:
  - name: instance
    image_owner: 099720109477
    image_name: ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*
    instance_type: t2.micro
    vpc_subnet_id: <your-aws-vpc-subnet-id>
    tags:
      - Name: molecule_instance
provisioner:
  name: ansible
verifier:
  name: ansible

All you need to do is fill in the subnet-id you want to create your test instance into. Then run

molecule test

Note

To make this work, you need to export your AWS credentials, as well as the AWS region you want to use, in your environment.

export AWS_ACCESS_KEY_ID=ACCESS_API_KEY
export AWS_SECRET_KEY=SECRET_API_KEY
export AWS_REGION=us-east-1

You can read more about managing AWS credentials with Ansible modules in the official documentation of the Ansible AWS modules

Documentation

Read the documentation and more at https://molecule.readthedocs.io/.

Get Involved

Authors

Molecule EC2 Plugin was created by Sorin Sbarnea based on code from Molecule.

License

The MIT License.

The logo is licensed under the Creative Commons NoDerivatives 4.0 License.

If you have some other use in mind, contact us.

molecule-ec2's People

Contributors

ssbarnea avatar ansible-zuul[bot] avatar lod avatar khuedoan avatar aruntomar avatar jgoldschrafe avatar jrobison-sb avatar tbugfinder avatar nicoggg avatar pabelanger avatar serenabiodec avatar troyready 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.