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:
- Terraform: Located in the
/proxmox-tfdirectory, Terraform provisions the raw Virtual Machines on our Proxmox cluster. It acts upon VM templates to configure basic hardware, networking, and Cloud-Init settings. - Ansible: Found in the
/ansible-labdirectory, Ansible playbooks configure the software inside the provisioned VMs. This includes installing Docker, deploying applications, and setting up CI/CD runners. - Make (Makefile): A central
Makefileacts 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 deployedsynthesis-apicontainer 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:
terraformansiblemake
Common Operations
A Makefile is provided in the root of the repository to streamline cluster operations:
- Provision Everything: run
make setup-allto 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.