Skip to main content

Infrastructure Automation

Welcome to the infrastructure automation documentation for the Abair environment. This project utilizes Infrastructure as Code (IaC) and Configuration Management to seamlessly automate the provisioning and setup of our Proxmox Virtual Machines.

Overview

Maintaining consistent and reproducible environments is critical for our operations. Our automation stack relies on three main components to achieve this:

  1. Terraform: Located in the /proxmox-tf directory, Terraform provisions the raw Virtual Machines on our Proxmox cluster. It acts upon VM templates to configure basic hardware, networking, and Cloud-Init settings.
  2. Ansible: Found in the /ansible-lab directory, Ansible playbooks configure the software inside the provisioned VMs. This includes installing Docker, deploying applications, and setting up CI/CD runners.
  3. Make (Makefile): A central Makefile acts as the orchestrator, wrapping Terraform and Ansible commands so you can provision and deploy the entire stack with a single command.

Managed Environments

Currently, this project maintains the following core infrastructure components on our private network:

  • docker-build (10.0.0.12): A GitHub Action runner environment designed to build local Docker images and push them to the local registry (10.0.0.2:5000).
  • synthesis-test (10.0.0.13): A dedicated testing environment designed to pull the deployed synthesis-api container from the local registry and spin it up safely using Docker Compose.

Getting Started

To interact with and deploy this infrastructure locally, you'll need to set up your environment:

1. Proxmox API Token

Terraform requires an API token to communicate with the Proxmox server safely. Export it in your environment before running workflows:

export TF_VAR_pm_api_token_secret="your_token_secret_here"

2. SSH Configuration (ProxyJump)

Since the Proxmox VMs reside on a private network, configure your ~/.ssh/config to jump through the public-facing edge/jump node:

Host docker-build synthesis-test
User ansible-control
ProxyJump <your-proxmox-jump-host>

Host docker-build
HostName 10.0.0.12

Host synthesis-test
HostName 10.0.0.13

3. Required Local Tooling

Ensure you have the following toolchain installed on your local workstation:

  • terraform
  • ansible
  • make

Common Operations

A Makefile is provided in the root of the repository to streamline cluster operations:

  • Provision Everything: run make setup-all to provision hardware and configure software across all environments in one step.
  • Setup Synthesis Test VM: run make setup-synthesis-test
  • Setup Docker Build VM: run make setup-docker-build

To update the software environments on existing machines without entirely rebuilding the hardware footprint, simply use make update-synthesis-test or make update-docker-build instead.