GithubHelp home page GithubHelp logo

foobatman / ansible-rails-setup Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 168 KB

An infrastructure management code using ansible to setup a comple Ruby on Rails stack with nginx as load balancer.

Nginx 100.00%

ansible-rails-setup's Introduction

Hey hi, 

Before setting up this box, 
You need to follow few steps to prove that you are cool enough.
  
  1. Install Ansible on your local box.
  2. Install vagrant and VirtualBox.
 
How to create base vagrant box:
  1. You better grab basic vagrant documentation. It is very easy. Even a stupid like Dhanesh could do it with ease.
  2. For basebox image, use this link: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box
  3. set an environment variable 'vagrant_base_box_url' pointing towards the local path where you have downloaded vagrant box
   
How to provision box using ansible code:
  
  1. cd /infra
  2. ansible-playbook -k site.yaml -i hosts ( -k is ask-password option, use it only if your provisioning particular box first time in your life,
                                              to setup SSH key authorization 
                                              -i is to specify Inventory (Ansible concept) i.e. hosts )
  NOTE: There are some issues with ubuntu 14.04 and version of ssh-pass that it has. Need to sort out !!!, By deafult on ubuntu boxes you will have to first run the failed attempt to get that vagrant boxe's key on your box and then you can run the above command to get your setup run smooth.

  3. When you will run this command, You will be asked for password. Enter your guest box's password. In this case it will be 'vagrant'
     provided that you have setup you default box with Vagrantfile from the source.
  4. That's it your good to go.

What Magic will this box do:
  1. For that go and see infra code yourself.

### Warnings ###
  1. Lots of places have hardcoded values so please don't touch them unless you know what you are doing. And I sure you it.


### How To Run: A six step process ###

 1. Become 'deploy' user
    sudo su - deploy 
    ( This should take you to the directory /home/deploy, do pwd if want to)

 2. Clone the code in application directory that is present there.
    git clone <git-repo url> application
 
 2. cd into 'application' directory. 
    "bundle install --path vendor/bundle"
 
 3. In the same ( application ) directory,
    run, "bundle exec rake db:create db:migrate db:seed db:test:prepare"
    (For this to run correctly make sure that, in your application's database.yml file you have, username: development and password: password for development environment ) 

 4. Then ,
    run sudo service nginx restart
 
 6. Try to hit the application's url from host browser like this "192.168.33.10" ( This is the static ip of your vagrant box )

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.