Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aboutlo/ansible-rails-app-aws
Build a multi environments (testing,staging,production) on Amazon ec2 instaces with Rails, Nginx, Unicorn and PostgreSQL using Ansible (1.8).
https://github.com/aboutlo/ansible-rails-app-aws
Last synced: 2 months ago
JSON representation
Build a multi environments (testing,staging,production) on Amazon ec2 instaces with Rails, Nginx, Unicorn and PostgreSQL using Ansible (1.8).
- Host: GitHub
- URL: https://github.com/aboutlo/ansible-rails-app-aws
- Owner: aboutlo
- License: bsd-3-clause
- Created: 2014-11-27T23:23:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-26T21:59:01.000Z (over 9 years ago)
- Last Synced: 2023-03-14T12:25:17.336Z (almost 2 years ago)
- Language: Python
- Size: 128 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
Build a single box with Rails 4.1.6, Nginx, Unicorn and PostgreSQL using Ansible (1.8).
You can deploy multiple rails apps on the same box.Moreover this project can create different stages:
- development on Vagrant
- testing on EC2)
- staging on EC2 *( Creation of vars/staging-env.yml using testing as model is required )*
- production on EC2 *( Creation of vars/production-env.yml using testing as model is required )*## Requirments
- Ansible > 1.8 `brew install ansible`
- Vagrant `brew install vagrant`
- VirtualBox `brew install virtualbox`
- SSH private and public key generated
- SSH key added to SSH Agent `ssh-add -K [path/to/private SSH key]` why SSH agent## Install roles
Install all required Ansible roles using `Ansiblefile.yml` as a sort of Gemfile
$ ansible-galaxy install -r requirements.yml
## Private keys
Create and download the private key in ~/.ec2/simple_app.pem
(e.g. eu-west-1 region )chmod 400 ~/.ec2/simple_app.pem
N.B. The keypair *MUST* has the same name of the project.
Otherwise you have to change on `testing-env.yml` the `instances_keypair` variable according to your keypair name## AWS Keys
Copy or create and download your AWS keys there:"~/.ec2/aws-${APP_NAME}.keys
## Setup site.yml (main Ansible playbook)
Basically it means choose ruby version, and some basic database and unicorn configs.
If you need a ruby version greater than 2.1.4 you have to update ruby-build versionrbenv_plugins:
- name: ruby-build
repo: "git://github.com/sstephenson/ruby-build.git"
version: v20141027Then you can provision your environment (development|testing|staging|production) specifying the app name
$ ./provision.sh simple_app development
To test your infrastructure deploy my micro rails app example: