-
Notifications
You must be signed in to change notification settings - Fork 0
Stage Data Setup
This details the things one must do to setup the alpha-stage-data machines from scratch using ansible play books.
-
From your local
devops-scripts/ansibledirectory, run the following command:ansible-playbook -i stage-hosts/ consul.yml -
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 onalpha-stage-data. At this point restart that instance in EC2 and re-run the command with-e restart=true. -
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 -
Next we must install vault, to do so run:
ansible-playbook -i stage-hosts/ vault.yml -
ssh alpha-stage-data -
sudo docker exec -it $(sudo docker ps | grep 'vault' | awk '{print $1}') sh -
vault init -address http://127.0.0.1:8200 -
Record the output from the init command and set the appropriate variables in
devops-scripts/ansible/stage-hosts/varibles -
ansible-playbook -i stage-hosts/ vault-values.yml -e write_root_creds=yes -
ansible-playbook -i stage-hosts/ vault-values.yml -e write_values=yes
-
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. -
In AWS reboot the alpha-stage-data host manually.
-
Once alpha-stage-data has rebooted run the following:
ansible-playbook -i stage-hosts/ redis.yml -e restart=true. The-e restart=trueindicates to the docker role that we are ready to install docker after a reboot, and the playbook should run successfully.
- One and done:
ansible-playbook -i stage-hosts/ swarm-manager.yml