Giter Club home page Giter Club logo

ansible-cloudformation's Introduction

A cloudformation template that accepts user inputs as parameters where applicable ( for example, Admin password). This template should setup VPC, create subnets, launch a CM instance, pull the necessary code (modules, classes, recipes etc) from a GIT repo (or S3), and configure the web instance for basic Drupal or Wordpress setup..

gitrepo = github

Make sure the following are installed before proceeding

  • git
  • python-boto
  • ansible

SETUP AWS CREDENTIALS

  • login into AWS console
    • click on IAM
    • then, Users
    • security credentials
    • lastly, generate security credentials
  • copy the credentials or download
  • On your terminal , run aws configure .. Note you will be prompted to input credentials
    • AWS Access Key ID [****************JWDA]:
    • AWS Secret Access Key [****************CWnI]:
    • Default region name [us-east-1]:
    • Default output format [json]:

NEXT STEP:

  • clone the git repository

  • In order to run ansible to run locally, we need to setup the host

    • Add
    [local]
    localhost
    

    to file /etc/ansible/hosts

    ABOUT ANSIBLE SCRIPT The Ansible directory layout :

  • Deployment.yml #inventory file

  • group_vars

    • all.yml # here we assign variables to EC2 instances
  • File ## contains the cloudformation script

The cloudformation script will creates the following :

  • 1 VPC
    • Creates a default "Main Route Table", "Security Group", "Network ACL"
  • 1 Public Subnet inside VPC
  • 2 Private Subnets inside VPC
  • 2 Security Groups (One for WebServer, One for DB Instance)
    • DBSecGroup : Allows traffic only on DB port
    • WebServerSecGroup : Allows traffic on SSH (22) and HTTP(80) ports
  • 1 EC2 Instance for WebServer ( Public Subnet )
  • 1 RDS Instance for Wordpress Database ( Private Subnet )
  • 1 Internet Gateway
  • 1 Route Table and 1 Route for the internet attached to the Public Subnet

RUN THE ANSIBLE SCRIPT :

I recommend a dry run first to simulate our deployment without actually deploying

ansible-playbook -i /etc/ansible/hosts deploy-wp.yml --check

next: actual deployment

ansible-playbook -i /etc/ansible/hosts deploy-wp.yml --verbose

ansible-cloudformation's People

Contributors

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