A Terraform provider for managing Turing Pi's Baseboard Management Controller (BMC), enabling power management, firmware flashing, and node provisioning.
- Power Management - Control power state of individual compute nodes (1-4)
- Firmware Flashing - Flash firmware images to nodes with automatic resource recreation
- Boot Verification - Monitor UART output with configurable patterns to verify successful boot
- Talos Linux Support - Built-in boot detection for Talos Linux clusters
- TLS Flexibility - Skip certificate verification for self-signed or expired BMC certificates
- Environment Variables - Configure provider via environment variables for CI/CD pipelines
The provider is available on the Terraform Registry. Terraform will automatically download it when you run terraform init.
terraform {
required_providers {
turingpi = {
source = "jfreed-dev/turingpi"
version = "1.0.5"
}
}
}
provider "turingpi" {
username = "root" # or TURINGPI_USERNAME env var
password = "turing" # or TURINGPI_PASSWORD env var
endpoint = "https://turingpi.local" # or TURINGPI_ENDPOINT env var (optional)
insecure = false # or TURINGPI_INSECURE env var (optional)
}Using environment variables:
export TURINGPI_USERNAME=root
export TURINGPI_PASSWORD=turing
export TURINGPI_ENDPOINT=https://192.168.1.100 # optional
export TURINGPI_INSECURE=true # optional, for self-signed/expired certsprovider "turingpi" {}Control node power state.
resource "turingpi_power" "node1" {
node = 1 # Node ID (1-4)
state = true # true = on, false = off
}Flash firmware to a node. Changes to node or firmware_file trigger resource recreation.
resource "turingpi_flash" "node1" {
node = 1
firmware_file = "/path/to/firmware.img"
}Comprehensive node management: power control, firmware flashing, and boot verification.
resource "turingpi_node" "node1" {
node = 1 # Node ID (1-4)
power_state = "on" # "on" or "off" (default: "on")
firmware_file = "/path/to/firmware.img" # optional
boot_check = true # Monitor UART for boot pattern (default: false)
boot_check_pattern = "login:" # Pattern to detect (default: "login:")
login_prompt_timeout = 120 # Timeout in seconds (default: 60)
}
# For Talos Linux, use the appropriate boot pattern:
resource "turingpi_node" "talos" {
node = 2
boot_check = true
boot_check_pattern = "machine is running and ready"
}See the examples directory for complete configurations:
- basic - Simple power control
- flash-firmware - Firmware flashing
- full-provisioning - Complete node management with boot verification
Requires Go 1.23+.
# Clone and build
git clone https://github.com/jfreed-dev/terraform-provider-turingpi.git
cd terraform-provider-turingpi
go build -o terraform-provider-turingpi
# Run tests
go test -v ./...
# Enable debug logging
export TF_LOG=DEBUG
terraform applySee LICENSE file.