Giter Club home page Giter Club logo

cwoaws-core's Introduction

CWOAWS CORE Ansible playbook

Note: This is a core Ansible Playbook, please review, customize per you needs, and test it first before applying on production environments! Please report any issues through GitHub or email me at [email protected] and I'll do my best to get back to you!

Recorded Terminal Session: http://cwoaws.s3-website.eu-central-1.amazonaws.com/session4.html

CWOAWS CORE Ansible playbook have a purpose to setup operational AWS VPC infrastructure, all services on EC2 instances, RDS, etc, and to allow later execution of separated Playbooks for deployments, etc.

CWOAWS CORE Ansible Playbook Tasks:

  • create 1 x VPC with 2 x VPC subnets in differrent AZ zones one AWS region,
  • create 1 x security group,
  • provision 2 x EC2 instances in 2 different AZ,
  • Install webservers role on both instances (includes of other roles is possible, webservers role is required to allow instances registration to ELB),
  • launch and configure public facing VPC ELB (cross_az_load_balancing) and attach VPC subnets,
  • deregister and register EC2 instances on ELB,
  • info about ELB dnsname is registered in vars file and later can be used for DNS configuration,

All information about VPC are defined in main.yml and vpc_info.yml(during playbook execution) files (AZ, regions, keypair, vpc, subnets, elb dns name info) .

Installation

Ansible and Boto installation Ubuntu 14.04 LTS

  • $ sudo apt-get install software-properties-common
  • $ sudo apt-add-repository ppa:ansible/ansible
  • $ sudo apt-get update
  • $ sudo apt-get install ansible
  • $ sudo apt-get install python-pip
  • $ sudo pip install boto

Download to folder /etc/ansible/

In aws console create IAM user with PowerUser privileges; Add in file /home/ubuntu/.boto

  • [Credentials]
  • aws_access_key_id = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Add in clean file /home/ubuntu/.ansible.cfg

  • [defaults]
  • host_key_checking = False
  • private_key_file=/home/ubuntu/keypair.pem

Run Playbook:

  • $ansible-playbook -i hosts deploy-aws-infra.yml

cwoaws-core's People

Watchers

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