Code Monkey home page Code Monkey logo

ansible-autoscaling's Introduction

Ansible-AutoScaling

Ansible Playbook to create Autoscaling group, Load balancer and website/application from Git.

Description:

This Ansible Playbook can be used to create AWS Auto Scaling Group, Load Balancer, Key Pair and Security Group and create desired number of EC2 instances with autoscaling group for the GIT website or application.

Features

  • This Playbook is uses Dynamic Inventory for managing the instances created by Autoscaling.
  • We can manage the playbook easily using the variables file and Vars_prompt which will ask for desired key name, desired security group name and instance type.
  • The playbook checks for chanages in Git files and update the EC2 instances one by one. The Ec2 updation process is done using second play and it uses Serial key word to run the updation one by one. This ensures that the website/application is always up and running even during updation process.

Major Ansible Modules Used

  1. ec2_key
  2. ec2_group
  3. ec2_elb_lb
  4. ec2_lc
  5. ec2_asg
  6. ec2_instance_info
  7. add_host
  8. git
  9. pause
  10. file

Variables from file

The variables used in this playbook are given below. You can edit these variables from file autoscaling_vars.yml ,

region: "Desired region name"                                   #Eg: ap-south-1
zone1: "Desired zone name"                                      #Eg: ap-south-1a
zone2: "Desired zone name"                                      #Eg: ap-south-1b
ami: "Desired AMI"                                              #Eg: ami-010aff33ed5991201
access_key: "your IAM access key"
secret_key: "your IAM secret key"            
git_url: "Git hub URL for the desired application/website"   
health_time: 25                                 
asg_min: 2
asg_max: 2
asg_desired: 2

How to use?

yum install git unzip -y
git clone https://github.com/MarkAntonyGit/Ansible-AutoScaling.git
cd Ansible-AutoScaling
vim autoscaling_vars.yml  <<--------- make necessary changes
ansible-playbook playbook_ansible_autoscaling.yml

Sample Screenshots

-- Play

-- Sample Website Updation

Connect with me

-------- ----------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------ -------------------------------------------------------

ansible-autoscaling's People

Contributors

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