Coder Social home page Coder Social logo

ansible-ec2-django's Introduction

Devops Assignment

  1. Script to provision an EC2 instance to deploy this app

    • Set the environment variable MYRA__SENTRY_DSN with a sentry dsn obtained by signing up to https://sentry.io
    • Deployment details
      • OS: Ubuntu 16.04; use ami-6edd3078
      • Server: Nginx
      • python 2.7
    • Restrict port access; allow only http and any other ports for deployment
    • Script should take in the number of servers and the size as input and deploy on that many server
    • ec2.sh num_servers server_size
    • ex: ec2.sh 1 t2.micro
  2. Ansible/Chef/Puppet or bash scripts to deploy subsequent code changes and config changes to the newly created servers

After running the first script, it should output the IP address of the new instances and we should be able to open the browser to that instance and see output

In developing the assignment, use git and try to keep a decent history of how you approached the project. When submitting, include the .git folder in the submission.

Notes: - Assume that there are no security groups or key paris setup in the AWS account - Your script will have to setup those as well - No need to setup VPC, just launch EC2 instances without that

Steps

Provisioning

  • Fork & clone the repo

  • Update the project_repo details with your GitHub repo url in ansible/vars.yml file

  • Configure AWS CLI

aws configure

  • From infra directory, run ec2.sh
./ec2.sh <instance_count> <instance_type>

Eg: ./ec2.sh 5 t2.micro

After the CloudFormation stack is complete, deploy your application.

Deployment

From ansible directory, run deploy.sh

./deploy.sh <ASG_name> <pem_filepath>

Eg: ./deploy.sh devops_dummy ../infra/devops-dummy.pem

Note: You can get the ASG name from the CloudFormation output or AWS Console

ansible-ec2-django's People

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.