-
Digital Ocean personal access token
-
SSH public key
id_rsa.pub
at~/.ssh/id_rsa.pub
-
*.tfvars
file should look like this -
do_token = "your digital ocean private access token"
- First, terraform apply
terraform apply
- Save the output
terraform output -json > ansible/output.json
- Now to run the ansible playbooks, let's
cd
into theansible/
directory
cd ansible
- Run this playbook to configure the NAT gateway
ansible-playbook nat_gateway.yaml
- Run this playbook to setup the app servers
ansible-playbook app_config.yaml
- Go back to the project root folder
cd ..
- To test the vpc you can run the
test-run.sh
script (inside the project root dir) which will curl the loadbalancer
chmod +x scripts/test-run.sh
./scripts/test-run.sh
- The output should demonstrate the Round Robin algorithm in action.
If you are on a Mac, chances are that the sed
command works differently to the Linux version of sed
To avoid any issues, follow these steps to install gnu-sed
in your command line.
brew install gsed
and add this to ~/.zshrc in your mac
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"