https://github.com/tableflip/tune-infrastructure
:trumpet: :floppy_disk: Infrastructure project for Tune
https://github.com/tableflip/tune-infrastructure
Last synced: 5 months ago
JSON representation
:trumpet: :floppy_disk: Infrastructure project for Tune
- Host: GitHub
- URL: https://github.com/tableflip/tune-infrastructure
- Owner: tableflip
- Created: 2016-03-30T15:15:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-22T16:43:54.000Z (over 9 years ago)
- Last Synced: 2025-02-15T12:46:43.750Z (over 1 year ago)
- Language: Nginx
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TUNE Infrastructure
**Ansible scripts for deploying and maintaining tune.tableflip.io**
```sh
├── group_vars # Config options
├── dev # Inventory for local vm
├── next # Inventory for staging vm
├── production # Inventory for LIVE vm
├── roles # Tasks, grouped by purpose
├── bootstrap.yml # Playbook to get a fresh vm ready for Ansible
├── deploy-app.yml # Playbook to deploy & update the app
└── Vagrantfile # Test the scripts locally with `vagrant up`
```
## Prerequisites
You need to add a `secrets.yml` file into `group_vars/all`.
This file contains all of the secrets for the deployments that we'd prefer not to keep in the repo.
## Usage
**To bootstrap a local test server with vagrant**
- Install Ansible
- Install Vagrant (`brew install vagrant`)
- Add `10.100.112.100 dev.tune.tableflip.io` to your local `/etc/hosts`
```sh
# Download and provision a vm
vagrant up
# Update vm with our roles
ansible-playbook -i dev deploy-app.yml
```
You now have a test vm, running locally
**To bootstrap a new production vm**
- Add the new remote to the relevant inventory
- Add your public ssh key in `/root/.ssh/authorized_keys` on the remote
```sh
# bootstrap ansible user
ansible-playbook -i production bootstrap.yml --extra-vars "ansible_user=root"
# Intall app and dependencies
ansible-playbook -i production deploy-app.yml
```