provisioning rails servers with ansible
TRANSCRIPT
Provisioning Rails Servers with Ansible
Radamanthus Batnag @radamanthus
https://github.com/radamanthus/
This talk is about
• Tasks in provisioning a Rails server
• Ansible
• My cool open-source ansible-rails playbook
• Life in general
New Server?No problem!
http://www.animschoolblog.com/2012/12/new-server-for-animschoolcom.html
No problem!
• Get the latest OS packages
• Disable all ports except port 22
• Harden sysctl settings
• Add ssh keys for deploy user
• Disable root ssh
No problem…
• Add Brightbox PPA
• Install Ruby
• Install Bundler
No problem?
• Add PostgreSQL PPA
• Create the deploy postgres user
• Create database.yml with the correct password
• Create the app database
Hmmm…
• Add Nginx PPA
• Install Nginx
• Remove default site
• upload myapp.conf Nginx config file
Aaargh
• Install the Puma gem
• add puma to /etc/init.d/
• Prepare the puma pid directory
• add app to /etc/puma.conf
• create monitrc for puma
In the old days, we had a recipe…
https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu
These days, we have
Ansible
Puppet
Chef
Demo
https://github.com/radamanthus/ansible-rails
Start Here!
Key Ansible Concepts
• Variables
• Includes
• Templates
• Files
• Roles
Walkthrough
Resources
• http://docs.ansible.com
• http://lattejed.com/first-five-and-a-half-minutes-on-a-server-with-ansible
• http://guides.spreecommerce.com/developer/ansible-ubuntu.html
• https://github.com/radar/ansible-rails-app
• https://github.com/radamanthus/ansible-rails
Thank You