- Install vagrant
- Install virtualbox
- Add your SSL certs as
./certs/lsd.*
into./certs
## Example:
certs/
├── lsd.crt
├── lsd.key
└── lsd.pem
- Configure Ansible inventory in
ansible/hosts.ini
:
[server]
<ip_vm1> ansible_user=ubuntu ansible_ssh_private_key_file=~/.ssh/id_rsa # aws oca-runner
[monitor]
<ip_vm3> ansible_user=ubuntu ansible_ssh_private_key_file=~/.ssh/id_rsa # aws monitor
[all:vars]
ansible_python_interpreter=/usr/bin/python3
- Configure Ansible vars in
ansible/deploy/vars.yml
andansible/monitor/vars.yml
:
---
# vars file for roles/deploy
container_port: 3000
container_name: oca-frontend-app
docker_image: ocaufcg/oca-frontend
dns_name: <your_dns>
---
# vars file for roles/monitor
dns_name: <your_dns>
ips_to_monitor: [<ip_vm1>, <ip_vm2>]
slack_api_url: 'https://hooks.slack.com/services/<your_slack_webhook_url>'
- Run a playbook on the inventory:
cd ansible
ansible-playbook playbook.yml
- Also, you can run using the Makefile:
# For initial setup
make ansible-setup
# For deployment
make ansible-deploy
# For monitoring configuration
make ansible-monitor
# To start Docker Compose services for deployment
make compose-deploy
# To start Docker Compose services for monitoring
make compose-monitor
terraform plan -out "tfplan"
terraform apply "tfplan"
- Start the Vagrant environment:
vagrant up
- To connect to the machines:
vagrant ssh vagrant-oca
vagrant ssh vagrant-monitoring
- To temporarily stop the machines:
vagrant halt
- To destroy the environment when no longer needed:
vagrant destroy