GithubHelp home page GithubHelp logo

pradeepchandra1306 / ansible-aws-ec2-provision Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricardofontanelli/ansible-aws-ec2-provision

0.0 1.0 0.0 107 KB

Tutorial to integrate Ansible provisioning with Amazos EC2 platform

Python 51.74% PHP 0.03% Smarty 46.71% Shell 1.52%

ansible-aws-ec2-provision's Introduction

Ansible Amazon AWS EC2 Provision:

Tutorial to integrate Ansible provisioning with Amazon EC2 platform, using an Ubuntu 14.04 LTS Desktop and creating an Ubuntu 14.04 LTS Server.

Install:

  • Install Ansible last version:
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
  • Install boto (python lib):
$ sudo apt-get install python-pip
$ pip install -U boto
  • Clone the repository inside /etc/ansible. Warning: it will replace your ansible files;

  • Create the ssh key (~/.ssh/id_ansible) and import it to EC2. Note the ssh key name, if you use a different name, change it inside /etc/ansible/hosts;

$ ssh-keygen -t rsa -f ~/.ssh/id_ansible
  • Change the file /etc/ansible/ec2_creation/vars/all.yml according the information about your EC2 environment, for example:
---
ec2_config:
    region: us-west-2
    zone: us-west-2c
    #Change it according the name that you put in Amazon
    keypair: ansible
    instance_type: t1.micro
    #It create a Ubuntu 14.04LTS
    image: ami-6989a659
    #Your subnet
    vpc_subnet_id: subnet-e7b7f8be
    #An security group name created at Amazon
    group: [lamp]
    assign_public_ip: true
    volume_size: 8
    instance_tag_name: TagNomeApp
    remote_user: ubuntu
    #The path to your local ssh file
    ssh_path: ~/.ssh/id_ansible
  • Export your Amazon credential to environment variables;
$ export AWS_ACCESS_KEY_ID=YOURKEYID
$ export AWS_SECRET_ACCESS_KEY=YOUSECRETKEY
  • Inside /etc/ansible/ec2_creation Run the command:
$ ansible-playbook -i hosts playbook.yml --private-key=[your ssh key file] -vvvv

More information:

Look this video for more information (audio PT-BR and subtitles in EN) or open an issue.

ansible-aws-ec2-provision's People

Contributors

ricardofontanelli avatar

Watchers

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