Giter VIP home page Giter VIP logo

infrastructure's Introduction

Prerequisites

On the machine where you are running this script, Ensure you have Ansible setup in your machine Install python modules boto and awscli

Ansible roles are tested in Ansible version 2.9.

Mac :

- sudo easy_install pip
- pip install ansible --user  
- pip install --user boto3 botocore
- pip install awscli --user
- brew install ansible

Configure aws-cli. Use AWS credentials provided in the aws_credentials.yml aws configure AWS Access Key ID: <AWS ACCESS KEY> AWS Secret Access Key: <AWS Secret Access Key> Default region name: <ap-south-1> Default output format: <json>

How to encrypt and decrypt Ansible vars: Make sure you have vault key present on the ansible.cfg path (~/.keys/projecteka_secret). ansible-vault encrypt vars/vars.yml ansible-vault decrypt vars/vars.yml

Add vars/ec2_key.pem key to connect to AWS:

eval "$(ssh-agent -s)" ansible-vault decrypt group_vars/ec2_key.pem ssh-add group_vars/ec2_key.pem

To create a new VPC and basic infrastructure, the following command is executed:

```ansible-playbook -i inventory/ vpc.yml -vvv```

To create a new ec2 Instance, the following command is executed:

```ansible-playbook -i inventory/ create_instance.yml  -vvv```

To provision a ec2 proxy Instance, the following command is executed

```ansible-playbook -i inventory/ provision.yml -t proxy  -vvv```

To provision a ec2 docker Instance, the following command is executed:

 ```ansible-playbook -i inventory/ provision.yml -t docker-provision  -vvv```

Update Ha-proxy configuration to add container dns:

```ansible-playbook -i inventory/ add_container_dns.yml -e "container_name=hip-dev docker_host=172.16.2.27 https_port=9052" -vvvv```
```ansible-playbook -i inventory/ add_container_dns.yml -e "container_name=hook docker_host=172.16.2.27 https_port=8555" -vvvv```
```ansible-playbook -i inventory/ add_container_dns.yml -e "container_name=hiu-dev docker_host=172.16.2.27 https_port=9053" -vvvv```
```ansible-playbook -i inventory/ add_container_dns.yml -e "container_name=consent-manager-dev docker_host=172.16.2.27 https_port=9051" -vvvv```

infrastructure's People

Contributors

nexengineer avatar ganesanarun avatar bipul-jha avatar imaditiagg avatar ajayvk-tw 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.