GithubHelp home page GithubHelp logo

savadev / terransible Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fdmsantos/terransible

0.0 1.0 0.0 18 KB

Deploy to AWS with Ansible and Terraform course on Linux Academy.

HCL 98.82% Shell 1.18%

terransible's Introduction

Terransible

These scripts are used for the "Deploy to AWS with Ansible and Terraform" course on Linux Academy.

Setup

Install Python

$ apt update
$ apt install python2.7
$ python --version

Install Python Pip

$ apt install python-pip
$ pip install --upgrade pip

Install Terraform

$ curl -O https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip
$ apt-get install unzip
$ mkdir /bin/terraform 
$ unzip terraform_0.11.8_linux_amd64.zip -d /usr/local/bin/
$ terraform --version

Install AWS Cli

$ python -m pip install awscli --upgrade
$ aws --version
$ apt-get update

Install Ansible

$ apt-get install software-properties-common
$ apt-add-repository ppa:ansible/ansible
$ apt-get update
$ apt-get install ansible
$ ansible --version

Configure Ansible

$ vi /etc/ansible/ansible.cfg
Uncomment "host_key_checking = False"

Configure SSH Key

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/kryptonite
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/kryptonite.
Your public key has been saved in /root/.ssh/kryptonite.pub.
The key fingerprint is:
SHA256:D6zbO5EZcw9p1uf64OyR/Ulg4La/Cw4oiVNtsZMRHLo [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
+----[SHA256]-----+

$ ssh-agent bash
$ ssh-add /root/.ssh/kryptonite
Identity added: /root/.ssh/kryptonite (/root/.ssh/kryptonite)
$ ssh-add -l
2048 SHA256:******************************* /root/.ssh/kryptonite (RSA)

Configure Aws Iam

  1. Login to Aws Console
  2. Got To IAM Service
  3. Add user (Access Type = Programmatic access)
  4. Click on Attach existing policies directly and Administrator Access
  5. Download .csv file with Access Key Id and Secret Access Key

Configure Aws Cli

Use the credentials in .csv file Should configure default region

$ aws configure --profile superhero
# To Test
$ aws ec2 describe-instances --profile superhero --region us-east-1

Create Delegation-Set

Execute the command and store ID Value

$ aws route53 create-reusable-delegation-set --caller-reference 1224 --profile superhero
{
    "Location": "https://route53.amazonaws.com/2013-04-01/delegationset/*********", 
    "DelegationSet": {
        "NameServers": [
            "*************", 
            "*************", 
            "*************", 
            "*************", 
        ], 
        "CallerReference": "1224", 
        "Id": "/delegationset/<ID>"
    }
}

Deploy

  1. Clone project
  2. Edit terraform.tfvars and change the vars. (It's mandatory change local ip and delegation_set. Should use delegation obtained in prior step)
  3. Execute terraform int
  4. Execute terraform apply
  5. Execute terraform destroy

Documentation

Original Repo

Infrastructure flowchart

terransible's People

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.