Skip to content

jfreed-dev/terraform-provider-turingpi

Terraform Provider for Turing Pi 2.5

Terraform Registry Go Release License

A Terraform provider for managing Turing Pi's Baseboard Management Controller (BMC), enabling power management, firmware flashing, and node provisioning.

Features

  • 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

Installation

The provider is available on the Terraform Registry. Terraform will automatically download it when you run terraform init.

Usage

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 certs
provider "turingpi" {}

Resources

turingpi_power

Control node power state.

resource "turingpi_power" "node1" {
  node  = 1       # Node ID (1-4)
  state = true    # true = on, false = off
}

turingpi_flash

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"
}

turingpi_node

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"
}

Examples

See the examples directory for complete configurations:

Development

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 apply

License

See LICENSE file.

About

Terraform provider for Turing Pi 2.5 BMC - manage node power, firmware flashing, and boot verification

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published