Skip to content
Ryan Sandor Richards edited this page Dec 10, 2015 · 2 revisions

This details the things one must do to setup the alpha-stage-data machines from scratch using ansible play books.

Consul & Vault

  1. From your local devops-scripts/ansible directory, run the following command: ansible-playbook -i stage-hosts/ consul.yml

  2. The initial runs of this playbook with fail due to docker not being fully installed on the alpha-stage-data* docks. To proceed get to the point where it fails on alpha-stage-data. At this point restart that instance in EC2 and re-run the command with -e restart=true.

  3. Now that consul is installed you will need to seed it with the data needed by dock-init, to do so run: ansible-playbook -i stage-hosts/ consul-values.yml -e write_values=yes

  4. Next we must install vault, to do so run: ansible-playbook -i stage-hosts/ vault.yml

  5. ssh alpha-stage-data

  6. sudo docker exec -it $(sudo docker ps | grep 'vault' | awk '{print $1}') sh

  7. vault init -address http://127.0.0.1:8200

  8. Record the output from the init command and set the appropriate variables in devops-scripts/ansible/stage-hosts/varibles

  9. ansible-playbook -i stage-hosts/ vault-values.yml -e write_root_creds=yes

  10. ansible-playbook -i stage-hosts/ vault-values.yml -e write_values=yes

Redis & RabbitMQ

  1. Run ansible-playbook -i stage-hosts/ redis.yml. This playbook includes the role for installing docker on the alpha-stage-data host. The first run of the playbook will intentionally fail, as the first pass needs to install packages that require a system reboot before actually installing docker and, eventually, creating a redis container.

  2. In AWS reboot the alpha-stage-data host manually.

  3. Once alpha-stage-data has rebooted run the following: ansible-playbook -i stage-hosts/ redis.yml -e restart=true. The -e restart=true indicates to the docker role that we are ready to install docker after a reboot, and the playbook should run successfully.

Swarm Manager

  1. One and done: ansible-playbook -i stage-hosts/ swarm-manager.yml

Clone this wiki locally