Adapted from https://github.com/radar/ansible-rails-app
- Ruby 2.1
- PostgreSQL
- nginx
- Puma (jungle)
- Change the app name and deploy directory in
vars/defaults.yml
- Rename
hosts.example
tohosts
and change it to your hosts. For Homebrew's ansible, please use/usr/local/etc/ansible/hosts
If you're using vagrant to create the box, please use the insecure SSH key --private-key= ~/.vagrant.d/insecure_private_key
in the ansible-playbook
command.
$ ansible-playbook -i hosts rails-app.yml -t deploy,postgresql,nginx
$ <deploy your app>
$ ansible-playbook -i hosts rails-app.yml -t puma
There is an example Capistrano deploy.rb
in this repository that you can use too.
- install Vagrant
- install VirtualBox
- install VirtualBox guest additions plugin
- install VirtualBox hosts updater plugin
Navigate to the root ansible-rails directory and run the following command:
$ vagrant up
This will do:
- download the virtualbox file (ubuntu)
- spin it up
- run the playbook rails-app-local.yml
- update hosts file so your server can be accessed at