Skip to content

Sample Ansible Playbook for Rack applications that installs Nginx, Passenger, Ruby 2.0.0, Bundler, and git. It also demonstrates how to deploy a basic Rack application using Ansible.

License

Notifications You must be signed in to change notification settings

mattsgarrison/ansible-rackserver

 
 

Repository files navigation

mazer-rackham

Sample Ansible Playbook for Rack applications that installs Nginx, Passenger, and Ruby 2.0.0. It also demonstrates how to deploy a basic Rack application from a git repository.

Specifically, it does the following:

  • Upgrades packages
  • Installs a few crucial programs like git, NTP, and Vim
  • Creates a deploy user that the application files will belong to
  • Adds an SSH public key to the deploy user's Authorized Keys file
  • Reconfigures OpenSSH to only allow access via SSH keys
  • Installs Ruby 2.0.0
  • Installs Bundler
  • Installs Nginx + Passenger
  • Sets up and enables an Nginx vhost
  • Creates all necessary application directories
  • Uses git to checkout the latest revision of the imgur-display codebase
  • Creates required symlinks
  • Uses bundler to install all Gem dependencies

Running this playbook will leave you with a fully-functional Rack application server that is ready to show you a random picture from imgur. With some incredibly minor adjustments, this playbook will deploy your own application! It's my hope that this will be helpful to anyone who needs to set up a similar server using Ansible.

This playbook will run on Ubuntu 12.04 LTS and higher, and also works on Debian 7.

Enjoy!

Testing this playbook with Vagrant

  • Install Ansible (this playbook requires version >1.2, which for now means you need the development version)
  • Download and install Vagrant
  • Copy or rename Vagrantfile.example to Vagrantfile
  • Copy or rename ansible_hosts.example to ansible_hosts
  • Comment out the user: root line from imgur-display-setup.yml and uncomment the two lines below Vagrant setup
  • Run vagrant up in a terminal from within this folder
  • When the Ansible provisioning completes, visit http://localhost:8080/ in your host machine's browser to view the running Rack app
  • Run vagrant halt to shutdown the VM
  • Run vagrant destroy to delete the VM's data

About

Sample Ansible Playbook for Rack applications that installs Nginx, Passenger, Ruby 2.0.0, Bundler, and git. It also demonstrates how to deploy a basic Rack application using Ansible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published