All Projects → bradymholt → Ansible Rails

bradymholt / Ansible Rails

Ansible playbook for provisioning and deploying a Rails/MySQL app to an Ubuntu server

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Ansible Rails

ansible-playbooks-in-practice
Repository contains all type of ansible playbooks
Stars: ✭ 31 (-55.07%)
Mutual labels:  ansible-playbooks
GalaxyKickStart
Ansible playbooks for Galaxy Server deployment
Stars: ✭ 23 (-66.67%)
Mutual labels:  ansible-playbooks
Macbook Configuration
Ansible playbooks for managing Mac workstation configuration
Stars: ✭ 51 (-26.09%)
Mutual labels:  ansible-playbooks
ansible-viz
Graph relationships between Ansible playbooks / roles / tasks / vars etc. via static analysis
Stars: ✭ 33 (-52.17%)
Mutual labels:  ansible-playbooks
stedding
Ansible playbooks for Laravel LEMP Stack
Stars: ✭ 31 (-55.07%)
Mutual labels:  ansible-playbooks
Ansible Rails
Ansible: Ruby on Rails Server
Stars: ✭ 317 (+359.42%)
Mutual labels:  ansible-playbooks
netascode
This repo contains an example of the virtual network of a fictitious company which you can use to play and to learn network automation. Public repository for Network as Code. NaC model.
Stars: ✭ 36 (-47.83%)
Mutual labels:  ansible-playbooks
Ubuntu Dev Machine Setup
Configure your Ubuntu 20.04 LTS and 20.10 Desktop
Stars: ✭ 63 (-8.7%)
Mutual labels:  ansible-playbooks
ansible-role-for-splunk
Splunk@Splunk's Ansible role for installing Splunk, upgrading Splunk, and installing apps/addons on Splunk deployments (VM/bare metal)
Stars: ✭ 75 (+8.7%)
Mutual labels:  ansible-playbooks
Ansible Playbooks
Ansible playbook collection that have been written for Ubuntu. Some of the playbooks are Elasticsearch, Mesos, AWS, MySql, Sensu, Nginx etc..
Stars: ✭ 429 (+521.74%)
Mutual labels:  ansible-playbooks
docker-mail-server
Ansible playbooks to deploy a full featured mail server stack using Docker.
Stars: ✭ 47 (-31.88%)
Mutual labels:  ansible-playbooks
ansible-st2
Ansible Roles and Playbooks to deploy StackStorm
Stars: ✭ 85 (+23.19%)
Mutual labels:  ansible-playbooks
Rak8s
Stand up a Raspberry Pi based Kubernetes cluster with Ansible
Stars: ✭ 354 (+413.04%)
Mutual labels:  ansible-playbooks
omnia
An open-source toolkit for deploying and managing high performance clusters for HPC, AI, and data analytics workloads.
Stars: ✭ 128 (+85.51%)
Mutual labels:  ansible-playbooks
Ansible Playbook
Ansible playbook to deploy distributed technologies
Stars: ✭ 61 (-11.59%)
Mutual labels:  ansible-playbooks
rak8s
Stand up a Raspberry Pi based Kubernetes cluster with Ansible
Stars: ✭ 362 (+424.64%)
Mutual labels:  ansible-playbooks
Ansible Playbooks
Playbooks for automating server procedures based on our Community guides
Stars: ✭ 285 (+313.04%)
Mutual labels:  ansible-playbooks
Centos7 Cis
Ansible CentOS 7 - CIS Benchmark Hardening Script
Stars: ✭ 64 (-7.25%)
Mutual labels:  ansible-playbooks
Wire Server Deploy
Code to install/deploy wire-server (on kubernetes)
Stars: ✭ 63 (-8.7%)
Mutual labels:  ansible-playbooks
Ansible Roles
Ansible Roles
Stars: ✭ 375 (+443.48%)
Mutual labels:  ansible-playbooks

ansible-rails

This project is an Ansible playbook for provisioning and deploying a Rails/MySQL app to an Ubuntu server. It is intended to be added to an existing Rails application folder. Tested with: Rails 5.1.5, Ruby 2.4.3, Ubuntu 16.04 (Xenial).

Demo

asciicast

Setup

  1. Ansible >= 2.4.1 must be installed

  2. This playbook assumes you are targeting MySQL for your production database and have gem 'mysql2' included in your Gemfile.

  3. From your Rails application folder run:

    \curl -sSL https://raw.githubusercontent.com/bradymholt/ansible-rails/master/installer.sh | bash
    

    which will:

    1. Add this project to a new folder in your app called "ops"
    2. Initialize the config file
    3. Add 2 new rake tasks to your Rakefile: provision and deploy.

    If you would prefer, you can run the commands in this file manually.

  4. Edit the ops/config.yml file and add your project configuration

Provisioning

Provisioning is used to to setup the the server and initially deploy the application.

To provision your server, run: rake provision. This will do the following:

  • Install the following:
    • RVM
    • Nginx
    • Phusion passenger
    • MySQL
    • Libraries: libxslt-dev, libxml2-dev, libmysqlclient-dev, imagemagick
  • Create a user with ssh access and sudo authorization
  • Setup a daily backup job to backup MySQL database to S3
  • Create an app directory with appropriate permissions where Nginx config is pointing to
  • Configure TLS (https) via Let's Encrypt
  • Define an environment variable named SECRET_KEY_BASE with a unique uuid value.
  • Deploy the application:
    • Precompile assets locally with rake assets:precompile.
    • Copy app files to to remote server in the deploy directory
    • Update config/database.yml on remote server with correct production db config
    • Run the following remotely:
    • bundle install
    • rake db:migrate RAILS_ENV="production"
    • rake tmp:clear
    • rake log:clear
    • touch tmp/restart.txt (restart the app)

Deploying

If you have already provisioned your server and want to redeploy changes to your Rails app, run rake deploy. This will only run the deploy tasks from the playbook and be much faster.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].