Files
hobbs-iac/README.md
T
pluto 3d3c1af237 Initial IaC setup: Nomad, Consul, Terraform, Ansible
- Ansible roles for Nomad and Consul installation
- Nomad job specs for Traefik and monitoring stack
- Terraform configuration for Nomad job management
- Enterprise naming convention inventory
- HashiCorp stack deployment playbook
2026-02-04 08:52:08 -06:00

5.6 KiB

Hobbs.farm Infrastructure as Code

Enterprise-grade infrastructure management using HashiCorp stack + Ansible.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         HOBBS.FARM IaC                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   ┌───────────┐     ┌───────────┐     ┌───────────┐            │
│   │ TERRAFORM │────▶│  ANSIBLE  │────▶│   NOMAD   │            │
│   │           │     │           │     │           │            │
│   │ • Infra   │     │ • Config  │     │ • Deploy  │            │
│   │ • State   │     │ • Install │     │ • Scale   │            │
│   │ • DNS     │     │ • Secure  │     │ • Monitor │            │
│   └───────────┘     └───────────┘     └───────────┘            │
│         │                 │                 │                   │
│         └────────────────┴────────────────┘                   │
│                           │                                     │
│   ┌───────────────────────┴───────────────────────┐            │
│   │              HASHICORP STACK                   │            │
│   │  ┌─────────┐  ┌─────────┐  ┌─────────┐       │            │
│   │  │  NOMAD  │  │ CONSUL  │  │  VAULT  │       │            │
│   │  │ orchest │◄─┤ service │◄─┤ secrets │       │            │
│   │  │ ration  │  │ mesh    │  │ mgmt    │       │            │
│   │  └─────────┘  └─────────┘  └─────────┘       │            │
│   └───────────────────────────────────────────────┘            │
│                                                                 │
│   ┌─────────────────────────────────────────────────┐          │
│   │                    HOSTS                         │          │
│   │  hf-pdocker-01 (primary)   hf-pdocker-02 (secondary)      │
│   │  192.168.86.192            192.168.86.45                   │
│   └─────────────────────────────────────────────────┘          │
└─────────────────────────────────────────────────────────────────┘

Directory Structure

hobbs-iac/
├── terraform/              # Infrastructure provisioning
│   ├── environments/       # Per-environment configs
│   │   └── prod/
│   ├── modules/           # Reusable modules
│   └── nomad-jobs/        # Nomad job definitions (HCL)
├── ansible/               # Configuration management
│   ├── inventory/         # Host inventory
│   ├── playbooks/         # Automation playbooks
│   ├── roles/             # Ansible roles
│   └── group_vars/        # Variables
├── nomad/                 # Nomad-specific configs
│   ├── jobs/              # Job specifications
│   ├── policies/          # ACL policies
│   └── templates/         # Job templates
├── consul/                # Consul configs
│   ├── config/            # Consul configuration
│   └── policies/          # ACL policies
├── vault/                 # Vault configs
│   ├── policies/          # Access policies
│   └── secrets/           # Secret definitions (encrypted)
└── scripts/               # Utility scripts

Quick Start

1. Bootstrap Hosts (Ansible)

cd ansible
ansible-playbook -i inventory/hosts.yml playbooks/bootstrap.yml

2. Install HashiCorp Stack

ansible-playbook -i inventory/hosts.yml playbooks/hashicorp-stack.yml

3. Initialize Terraform

cd terraform/environments/prod
terraform init
terraform plan
terraform apply

4. Deploy Services

# Deploy all Nomad jobs
nomad job run ../nomad-jobs/traefik.nomad
nomad job run ../nomad-jobs/monitoring.nomad
# ... etc

Naming Convention

See Naming Convention Standard

Type Format Example
Physical hf-p<function>-## hf-pdocker-01
Virtual hf-v<function>-## hf-vapp-01
Container hf-c<function>-## hf-cproxy-01
Network hf-n<function>-## hf-nfw-01
Storage hf-s<function>-## hf-snas-01

Prerequisites

  • Ansible 2.15+
  • Terraform 1.5+
  • Nomad 1.6+
  • Consul 1.16+
  • Vault 1.15+

License

Private - Hobbs.farm internal use only