Skip to content

OCA-UFCG/oca-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oca-infra

Installation

Always required

Test required

Configuration

Certs configuration

  1. Add your SSL certs as ./certs/lsd.* into ./certs
## Example:
certs/
├── lsd.crt
├── lsd.key
└── lsd.pem

Ansible Configuration

  1. 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
  1. Configure Ansible vars in ansible/deploy/vars.yml and ansible/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>'

Usage

Running Ansible Playbooks

  1. Run a playbook on the inventory:
cd ansible
ansible-playbook playbook.yml
  1. 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

Running Terraform Scripts

terraform plan -out "tfplan"
terraform apply "tfplan"

Testing with Vagrant

  1. Start the Vagrant environment:
vagrant up
  1. To connect to the machines:
vagrant ssh vagrant-oca
vagrant ssh vagrant-monitoring
  1. To temporarily stop the machines:
vagrant halt
  1. To destroy the environment when no longer needed:
vagrant destroy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published