Giter Club home page Giter Club logo

ansible-role-aws's Introduction

ansible-role-aws

An Ansible role that creates EC2 instances, Security groups in AWS cloud environment. Public DNS names of the EC2 instances are updated in the inventory file for further use in other roles/playbook.

This role has the support for delete,stop and start the EC2 instances apart from create.

Requirements

python package version 2.6 or greater is installed on the ansible machine. boto package installed on the ansible machine. AWS access key environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY need to be set. AWS key pair should be created to connect to the instances.

Role Variables

Available Variables are listed below, they can be defined for all the instances in the default/main.yml or individually in the inventory file.

AWS region where the EC2 instance has to be created

 aws_region: ap-south-1

AWS instance type to specify the CPU and memory requirement

 instance_type: t2.micro

AWS image ID to identify the OS and host the machine

 image_id: ami-ac1e68c3

AWS security group the instances will be attached to. if it is not available already, new group will be created with limited access

 security_group_name: "security123"

AWS Key pair to connect to the AWS instance, create it manually.

 sshkeypair_name: my_key

AWS EBS storage disk size to be provisioned in GB

  disk: 10

Dependencies

none

Example Playbook

Creating EC2 instances in AWS cloud.

- hosts: instances
  connection: local
  vars:
    operation: createhosts

  roles:
    - SathiyarajPeriyannan.aws

Starting EC2 instances in AWS cloud.

- hosts: instances
  connection: local
  vars:
    operation: starthosts

  roles:
    - SathiyarajPeriyannan.aws

Stoping EC2 instances in AWS cloud.

- hosts: instances
  connection: local
  vars:
    operation: stophosts

  roles:
    - SathiyarajPeriyannan.aws

Deleting EC2 instances in AWS cloud.

- hosts: instances
  connection: local
  vars:
    operation: deletehosts

  roles:
    - SathiyarajPeriyannan.aws

License

BSD

Author Information

This role was created in 2018 by Sathiyaraj Periyannan

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.