Four simple steps:
- for mac
- brew install ansible
- for ubuntu
- sudo apt-get install software-properties-common
- sudo apt-add-repository ppa:ansible/ansible
- sudo apt-get update
- sudo apt-get install ansible
Be advised that the root play contains tasks for setting up linux environment and creates a user for deploying an application, in order to use it you need a user with root privileges on target machine. User play sets up rvm, rubies and deploys actual application. It doesn't require root privileges.
If you have already configured remote machine, you can skip root play and simply run:
- 'ansible-playbook plays/user.yml'
Do not forget to add target machine ssh key to a repo you will be pull from.
If you don't want to install rvm and deploy any app, you can create new user, install and configure Postgresql, MySQL, Nginx, NodeJs, Redis and common libraries such as libpq-dev, openssl etc by simply run:
- 'ansible-playbook plays/root.yml'
- 'ansible-playbook plays/deploy.yml'
- 'ansible-playbook plays/restart.yml'
- Create user for deploy (using root privileges on remote machine)
- Print new user ssh key to console
- Copy your ssh key to remote machine in order to simplify further ssh connections
- Install RDBMS, packages and libraries
- Setup Postgresql and MySQL
- Configure Nginx
- Install RVM
- Install Ruby
- Set up project directory(create subfolders and symlinks)
- Pull project from git
- Configure database.yml and secrets.yml
- Install gems
- Run migrations
- Configure app server
- Run the application
- Postgresql
- MySQL
- SQLite
- Redis
- Unicorn