Use this ansible playbook to setup a fresh server with the following components:
- Nginx
- Puma App Server
- Certbot (Let's Encrypt)
- PostgreSQL
- Memcached
- Redis
- Sidekiq
- Monit (to keep Puma and Sidekiq runnig)
- Elasticsearch
- ruby-install
- rbenv
- Directories to deploy Rails with Capistrano and Puma App Server (see below)
- Swapfile (useful for small DO instances)
- Tools (tmux, vim, htop, git, wget, curl etc.)
- DB backup using backup gem
- Logrotate
Brew
brew install ansible
APT
apt-get install ansible
-
Copy
hosts.example
tohosts
and modify the contents. -
Copy
group_vars/all.example
togroup_vars/all
and modify the contentes.There are a bunch of things you can set in
group_vars/all
. Don't forget to add your host address tohosts
.
cp hosts.example hosts
cp group_vars/all.example group_vars/all
Run ansible-playbook site.yml -i hosts
.
For setuping Rails application use Blueprint Gem
Feel free to send feedback or report problems via GitHub issues!