With this ansible playbook you can run the Weight Tracker app on the azure resources that are built in this Terraform module- https://github.com/UrielOfir/Terraform. The app will run as a docker container.
- Connect to the ansible VM you have in your environment. (The user name and password are the same as the one you used to create the VM, you can find them in the
.tfvars
files and your Terraform output.) - Clone this repo to your machine-
git clone https://github.com/UrielOfir/ansible
. - Install ansible
- Run the command
export ANSIBLE_HOST_KEY_CHECKING=False
to enable connection to the hosts machines with user name and password. - Add the file
inventory
. The file should contain this data:<vm1 ip> host="<vm1 ip>" <vm2 ip> host="<vm2 ip>" etc...
You should add this file to your .gitigonre
because it contains secret data.
(The user name and password are the same as the one you used to create the VM, you can find them in the .tfvars
files on your Terraform pfoject, or in the terraform output)
- In
ansible
directory add the filevars
. This file should contain this data:# the host variable is in the inventory file pghost: "<your postgresql service address> pg_username: "<postgresql username>" pg_password: "<postgresql password>" LB_ip: "<your load balancer public ip address>" okta_url: "<your okta url>" okta_client_id: "<your okta client id>" okta_client_secret: "<your okta client secret>" ansible_connection: "ssh" ansible_port: "22" ansible_user: "<user name>" ansible_ssh_pass: "<password>"
You should add this file to your .gitigonre
because it contains secret data.
(The postgres user name and password are the same as the one you used to create the service, you can find them in the .tfvars
files on your Terraform pfoject, or in the terraform output)
-
Add the load balancer public ip to your okta app sign-in redirect URIs.
-
Run the command
ansible-playbook -i inventory weightTrackerPlayBook.yaml
.