DigitalOcean Deployment

Production deployment using Terraform and Ansible.

Prerequisites

  • DigitalOcean account

  • doctl CLI installed

  • Terraform >= 1.0

  • Ansible >= 2.10

# Install doctl
brew install doctl

# Install Terraform
brew install terraform

# Install Ansible
brew install ansible

Droplet Provisioning

1. Configure DigitalOcean Token

2. Configure Terraform Variables

Edit terraform.tfvars:

3. Initialize Terraform

4. Plan and Apply

SSH Setup

1. Connect to Droplet

2. Configure SSH Key

Ansible Provisioning

1. Update Inventory

Edit infrastructure/ansible/inventory.ini:

2. Run Provisioning Playbook

This playbook:

  • Installs Docker

  • Configures firewall

  • Sets up monitoring

  • Creates necessary directories

3. Deploy Agent

Verify Deployment

1. Check Docker Containers

2. Check Agent Logs

3. Test Agent Endpoint

Infrastructure Overview

Maintenance

Update Agent

Scale Droplet

Destroy Infrastructure

Troubleshooting

SSH Connection Failed

Docker Not Running

Agent Not Starting

Last updated