Sprint 5 WPPL - Infrastructure (Aplikasi absensi online --> Square Check)
The first thing to do is to fill up the variables needed by terraform
$ cd terraform
$ cp terraform.tfvars.example terraform.tfvars
$ nano terraform.tfvars
In terraform.tfvars
there will be guide on how to get the value for your account
After filling up the variables, you can now run terraform commands
$ terraform init
$ terraform plan
$ terraform apply
To delete your server you can use the below command to do so.
$ terraform destroy
Before going with the process, please check your inventory
file and group_vars/all
file
On the group_vars/all
there are some additional env variables that need to be filled
Then, copy your .env
for backend to roles/web/files/.env
or you could fill up with the .env.example
$ cp roles/web/files/.env.example roles/web/files/.env
$ nano .env
Install Ansible Playbook Dependencies
$ ansible-galaxy collection install ansible.posix
$ ansible-galaxy collection install amazon.aws
Lastly, run the ansible command to configure your server
$ cd ansible
$ ansible-playbook -i inventory square_check_all.yml
For testing on local test command to run docker-compose are below
use -f
flag because docker-compose file are not default
$ cd docker
$ docker-compose -f docker-compose.prod.yml up -d