{"id":34203996,"url":"https://github.com/jfreed-dev/terraform-provider-turingpi","last_synced_at":"2026-03-07T20:01:20.119Z","repository":{"id":267202745,"uuid":"900366293","full_name":"jfreed-dev/terraform-provider-turingpi","owner":"jfreed-dev","description":"Terraform provider for Turing Pi 2.5 BMC. Use with jfreed-dev/modules/turingpi for cluster deployment.","archived":false,"fork":false,"pushed_at":"2026-01-12T04:26:58.000Z","size":347,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T15:44:34.782Z","etag":null,"topics":["golang","homelabs","infrastructure-as-a-code","k3s","k3s-cluster","k8s-stack","kubernetes-cluster","rk3588","rkllm","rkllm-runtime","rockchip","talos-cloud","terraform-modules","terraform-providers","turing-pi"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/jfreed-dev/turingpi/latest","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfreed-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-08T15:43:10.000Z","updated_at":"2026-01-12T04:27:00.000Z","dependencies_parsed_at":"2024-12-09T15:25:42.524Z","dependency_job_id":"103495dc-05f4-444f-9396-578c20bed57d","html_url":"https://github.com/jfreed-dev/terraform-provider-turingpi","commit_stats":null,"previous_names":["jfreed-dev/turingpi-terraform-provider","jfreed-dev/terraform-provider-turingpi"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/jfreed-dev/terraform-provider-turingpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fterraform-provider-turingpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fterraform-provider-turingpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fterraform-provider-turingpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fterraform-provider-turingpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfreed-dev","download_url":"https://codeload.github.com/jfreed-dev/terraform-provider-turingpi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfreed-dev%2Fterraform-provider-turingpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28543785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","homelabs","infrastructure-as-a-code","k3s","k3s-cluster","k8s-stack","kubernetes-cluster","rk3588","rkllm","rkllm-runtime","rockchip","talos-cloud","terraform-modules","terraform-providers","turing-pi"],"created_at":"2025-12-15T19:02:44.223Z","updated_at":"2026-03-07T20:01:20.112Z","avatar_url":"https://github.com/jfreed-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider for Turing Pi 2.5\n\n[![Terraform Registry](https://img.shields.io/badge/terraform-registry-blueviolet)](https://registry.terraform.io/providers/freed-dev-llc/turingpi)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/freed-dev-llc/terraform-provider-turingpi)](https://go.dev/)\n[![Go](https://github.com/freed-dev-llc/terraform-provider-turingpi/actions/workflows/go.yml/badge.svg)](https://github.com/freed-dev-llc/terraform-provider-turingpi/actions/workflows/go.yml)\n[![Security](https://github.com/freed-dev-llc/terraform-provider-turingpi/actions/workflows/security.yml/badge.svg)](https://github.com/freed-dev-llc/terraform-provider-turingpi/actions/workflows/security.yml)\n[![codecov](https://codecov.io/gh/freed-dev-llc/terraform-provider-turingpi/graph/badge.svg)](https://codecov.io/gh/freed-dev-llc/terraform-provider-turingpi)\n[![Release](https://img.shields.io/github/v/release/freed-dev-llc/terraform-provider-turingpi)](https://github.com/freed-dev-llc/terraform-provider-turingpi/releases/latest)\n[![Downloads](https://img.shields.io/github/downloads/freed-dev-llc/terraform-provider-turingpi/total)](https://github.com/freed-dev-llc/terraform-provider-turingpi/releases)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)\n\nA Terraform provider for managing Turing Pi's Baseboard Management Controller (BMC), enabling power management, firmware flashing, and node provisioning.\n\n## Features\n\n- **Power Management** - Control power state of individual compute nodes (1-4)\n- **Firmware Flashing** - Flash firmware images to nodes with automatic resource recreation\n- **BMC Firmware Upgrade** - Upgrade BMC firmware with file upload or local file support\n- **BMC Reboot \u0026 Reload** - Trigger BMC reboot or daemon reload with readiness monitoring\n- **UART Access** - Read and write to node serial consoles for boot monitoring and command execution\n- **Boot Verification** - Monitor UART output with configurable patterns to verify successful boot\n- **USB Routing** - Configure USB routing between nodes and USB-A connector or BMC\n- **USB Boot Mode** - Enable USB boot mode for CM4 provisioning and MSD access\n- **Network Reset** - Trigger network switch reset for recovery after configuration changes\n- **Storage Monitoring** - Query SD card storage capacity and usage\n- **Talos Linux Support** - Built-in boot detection for Talos Linux clusters\n- **TLS Flexibility** - Skip certificate verification for self-signed or expired BMC certificates\n- **Environment Variables** - Configure provider via environment variables for CI/CD pipelines\n\n## Terraform Modules\n\nFor cluster deployment, we recommend using the composable [terraform-turingpi-modules](https://github.com/freed-dev-llc/terraform-turingpi-modules) repository:\n\n| Module | Description |\n|--------|-------------|\n| `flash-nodes` | Flash firmware to Turing Pi nodes |\n| `talos-cluster` | Deploy Talos Kubernetes cluster (uses native Talos provider) |\n| `k3s-cluster` | Deploy K3s Kubernetes cluster on Armbian via SSH |\n| `metallb` | MetalLB load balancer addon |\n| `ingress-nginx` | NGINX Ingress controller addon |\n| `longhorn` | Distributed block storage with NVMe support |\n| `monitoring` | Prometheus, Grafana, Alertmanager stack |\n| `portainer` | Cluster management agent (CE/BE) |\n\n### Helper Scripts\n\nThe modules repository includes helper scripts for cluster lifecycle management:\n\n| Script | Description |\n|--------|-------------|\n| [`cluster-preflight.sh`](https://github.com/freed-dev-llc/terraform-turingpi-modules/blob/main/scripts/cluster-preflight.sh) | Pre-deployment validation (tools, BMC, node connectivity) |\n| [`talos-wipe.sh`](https://github.com/freed-dev-llc/terraform-turingpi-modules/blob/main/scripts/talos-wipe.sh) | Wipe Talos cluster (NVMe + eMMC) and shutdown nodes |\n| [`k3s-wipe.sh`](https://github.com/freed-dev-llc/terraform-turingpi-modules/blob/main/scripts/k3s-wipe.sh) | Wipe K3s cluster (NVMe + eMMC) and shutdown nodes |\n| [`find-armbian-image.sh`](https://github.com/freed-dev-llc/terraform-turingpi-modules/blob/main/scripts/find-armbian-image.sh) | Find Armbian images and generate autoconfig files |\n\n\u003e **Note:** The `turingpi_k3s_cluster` and `turingpi_talos_cluster` resources are deprecated and will be removed in v2.0.0. See the [Migration Guide](docs/MIGRATION.md) for upgrade instructions.\n\n## Documentation\n\n- **[Architecture](docs/ARCHITECTURE.md)** - System diagrams, data flows, and component interactions\n- **[Migration Guide](docs/MIGRATION.md)** - Migrate from deprecated cluster resources\n- **[Terraform Registry](https://registry.terraform.io/providers/freed-dev-llc/turingpi)** - Provider documentation\n\n## Installation\n\nThe provider is available on the [Terraform Registry](https://registry.terraform.io/providers/freed-dev-llc/turingpi). Terraform will automatically download it when you run `terraform init`.\n\n## Usage\n\n```hcl\nterraform {\n  required_providers {\n    turingpi = {\n      source  = \"freed-dev-llc/turingpi\"\n      version = \"~\u003e 1.4.0\"\n    }\n  }\n}\n\nprovider \"turingpi\" {\n  username = \"root\"                      # or TURINGPI_USERNAME env var\n  password = \"turing\"                    # or TURINGPI_PASSWORD env var\n  endpoint = \"https://turingpi.local\"    # or TURINGPI_ENDPOINT env var (optional)\n  insecure = false                       # or TURINGPI_INSECURE env var (optional)\n}\n```\n\nUsing environment variables:\n\n```bash\nexport TURINGPI_USERNAME=root\nexport TURINGPI_PASSWORD=turing\nexport TURINGPI_ENDPOINT=https://192.168.1.100  # optional\nexport TURINGPI_INSECURE=true                   # optional, for self-signed/expired certs\n```\n\n```hcl\nprovider \"turingpi\" {}\n```\n\n## Data Sources\n\n### turingpi_info\n\nRetrieve BMC information including version, network, storage, and node power status.\n\n```hcl\ndata \"turingpi_info\" \"bmc\" {}\n\noutput \"firmware_version\" {\n  value = data.turingpi_info.bmc.firmware_version\n}\n\noutput \"node_power_status\" {\n  value = data.turingpi_info.bmc.nodes\n}\n```\n\n### turingpi_usb\n\nRetrieve current USB routing configuration.\n\n```hcl\ndata \"turingpi_usb\" \"current\" {}\n\noutput \"usb_config\" {\n  value = {\n    mode  = data.turingpi_usb.current.mode   # \"host\" or \"device\"\n    node  = data.turingpi_usb.current.node   # 1-4\n    route = data.turingpi_usb.current.route  # \"usb-a\" or \"bmc\"\n  }\n}\n```\n\n### turingpi_power\n\nRetrieve current power status of all nodes.\n\n```hcl\ndata \"turingpi_power\" \"status\" {}\n\noutput \"power_status\" {\n  value = {\n    node1      = data.turingpi_power.status.node1  # true/false\n    nodes_on   = data.turingpi_power.status.powered_on_count\n    nodes_off  = data.turingpi_power.status.powered_off_count\n  }\n}\n```\n\n### turingpi_uart\n\nRead buffered UART (serial console) output from a node. Reading clears the buffer.\n\n```hcl\ndata \"turingpi_uart\" \"node1\" {\n  node = 1\n}\n\noutput \"node1_output\" {\n  value = data.turingpi_uart.node1.output\n}\n```\n\n### turingpi_sdcard\n\nRetrieve microSD card storage information.\n\n```hcl\ndata \"turingpi_sdcard\" \"storage\" {}\n\noutput \"sdcard_info\" {\n  value = {\n    total_gb     = data.turingpi_sdcard.storage.total_gb\n    free_gb      = data.turingpi_sdcard.storage.free_gb\n    used_percent = data.turingpi_sdcard.storage.used_percent\n  }\n}\n```\n\n### turingpi_about\n\nRetrieve BMC daemon version information.\n\n```hcl\ndata \"turingpi_about\" \"bmc\" {}\n\noutput \"bmc_versions\" {\n  value = {\n    api      = data.turingpi_about.bmc.api_version\n    firmware = data.turingpi_about.bmc.firmware_version\n    daemon   = data.turingpi_about.bmc.daemon_version\n  }\n}\n```\n\n## Resources\n\n### turingpi_power\n\nControl node power state with on, off, and reset support.\n\n```hcl\nresource \"turingpi_power\" \"node1\" {\n  node  = 1       # Node ID (1-4)\n  state = \"on\"    # \"on\", \"off\", or \"reset\"\n}\n\n# Reset (reboot) a node\nresource \"turingpi_power\" \"node2_reset\" {\n  node  = 2\n  state = \"reset\"\n}\n```\n\n### turingpi_flash\n\nFlash firmware to a node. Changes to `node` or `firmware_file` trigger resource recreation.\n\n```hcl\nresource \"turingpi_flash\" \"node1\" {\n  node          = 1\n  firmware_file = \"/path/to/firmware.img\"\n}\n```\n\n### turingpi_usb\n\nManage USB routing between nodes and the USB-A connector or BMC.\n\n```hcl\nresource \"turingpi_usb\" \"node1\" {\n  node  = 1           # Node ID (1-4)\n  mode  = \"host\"      # \"host\" or \"device\"\n  route = \"usb-a\"     # \"usb-a\" or \"bmc\" (default: \"usb-a\")\n}\n```\n\n### turingpi_network_reset\n\nTrigger a network switch reset. Useful for recovering network connectivity after node power changes or firmware updates.\n\n```hcl\nresource \"turingpi_network_reset\" \"switch\" {\n  triggers = {\n    # Reset network when node power changes\n    node_states = join(\",\", [for k, v in turingpi_power.nodes : \"${k}:${v.current_state}\"])\n  }\n}\n```\n\n### turingpi_bmc_firmware\n\nUpgrade the BMC firmware. Supports uploading from Terraform host or using a file on the BMC filesystem.\n\n```hcl\nresource \"turingpi_bmc_firmware\" \"upgrade\" {\n  firmware_file = \"/path/to/bmc-firmware.swu\"\n  timeout       = 300\n}\n\n# Or use a file already on the BMC\nresource \"turingpi_bmc_firmware\" \"upgrade_local\" {\n  firmware_file = \"/tmp/firmware.swu\"\n  bmc_local     = true\n}\n```\n\n### turingpi_uart\n\nWrite commands to a node's UART (serial console).\n\n```hcl\nresource \"turingpi_uart\" \"node1_cmd\" {\n  node    = 1\n  command = \"echo 'Hello from Terraform'\\n\"\n}\n```\n\n### turingpi_bmc_reboot\n\nTrigger a BMC reboot with optional readiness wait.\n\n```hcl\nresource \"turingpi_bmc_reboot\" \"maintenance\" {\n  wait_for_ready = true\n  ready_timeout  = 120\n}\n```\n\n### turingpi_bmc_reload\n\nRestart the BMC daemon (softer than full reboot).\n\n```hcl\nresource \"turingpi_bmc_reload\" \"daemon\" {\n  wait_for_ready = true\n  ready_timeout  = 30\n}\n```\n\n### turingpi_usb_boot\n\nEnable USB boot mode for a node (pulls nRPIBOOT pin low for CM4).\n\n```hcl\nresource \"turingpi_usb_boot\" \"node1\" {\n  node = 1\n}\n```\n\n### turingpi_node_to_msd\n\nReboot a node into USB Mass Storage Device mode.\n\n```hcl\nresource \"turingpi_node_to_msd\" \"node1\" {\n  node = 1\n}\n```\n\n### turingpi_clear_usb_boot\n\nClear USB boot status for a node.\n\n```hcl\nresource \"turingpi_clear_usb_boot\" \"node1\" {\n  node = 1\n}\n```\n\n### turingpi_node\n\nComprehensive node management: power control, firmware flashing, and boot verification.\n\n```hcl\nresource \"turingpi_node\" \"node1\" {\n  node                 = 1                              # Node ID (1-4)\n  power_state          = \"on\"                           # \"on\" or \"off\" (default: \"on\")\n  firmware_file        = \"/path/to/firmware.img\"        # optional\n  boot_check           = true                           # Monitor UART for boot pattern (default: false)\n  boot_check_pattern   = \"login:\"                       # Pattern to detect (default: \"login:\")\n  login_prompt_timeout = 120                            # Timeout in seconds (default: 60)\n}\n\n# For Talos Linux, use the appropriate boot pattern:\nresource \"turingpi_node\" \"talos\" {\n  node               = 2\n  boot_check         = true\n  boot_check_pattern = \"machine is running and ready\"\n}\n```\n\n## Examples\n\nSee the [examples](./examples) directory for complete configurations:\n\n- [basic](./examples/basic) - Simple power control\n- [flash-firmware](./examples/flash-firmware) - Firmware flashing\n- [full-provisioning](./examples/full-provisioning) - Complete node management with boot verification\n\n## Development\n\nRequires [Go 1.25+](https://go.dev/).\n\n```bash\n# Clone and build\ngit clone https://github.com/freed-dev-llc/terraform-provider-turingpi.git\ncd terraform-provider-turingpi\ngo build -o terraform-provider-turingpi\n\n# Run tests\ngo test -v ./...\n\n# Enable debug logging\nexport TF_LOG=DEBUG\nterraform apply\n```\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfreed-dev%2Fterraform-provider-turingpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfreed-dev%2Fterraform-provider-turingpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfreed-dev%2Fterraform-provider-turingpi/lists"}