Compare commits

12 Commits
Author SHA1 Message Date
sohcato 6f6fe76d28 update path
Terraform CI / terraform (push) Successful in 17s
2026-10-01 02:05:16 -07:00
sohcato 5773a63851 omit api_token
Terraform CI / terraform (push) Successful in 32s
2026-10-01 01:45:53 -07:00
sohcato 171634506f comment out interactive variables
Terraform CI / terraform (push) Failing after 14s
2026-10-01 01:44:20 -07:00
sohcato 86404dc960 formatting
Terraform CI / terraform (push) Canceled after 1m2s
2026-10-01 01:26:00 -07:00
sohcato 6abf33ccd4 remove ssh priv key hardcoded path
Terraform CI / terraform (push) Failing after 11s
2026-10-01 01:25:27 -07:00
sohcato 9841a2cbb6 add proxmox ssh private key env var
Terraform CI / terraform (push) Failing after 15s
2026-10-01 01:24:36 -07:00
sohcato ab6556c90f fix workflow working dir path
Terraform CI / terraform (push) Failing after 16s
2026-10-01 01:15:11 -07:00
sohcato ede86a27ee add terraform setup to workflow
Terraform CI / terraform (push) Failing after 20s
2026-10-01 01:13:09 -07:00
sohcato 6804626863 small fixes
Terraform CI / terraform (push) Failing after 4s
2026-09-30 23:48:09 -07:00
sohcato c37be20417 fix tabbing in workflow
Terraform CI / terraform (push) Failing after 1s
2026-09-30 23:45:21 -07:00
sohcato 27c2be3ca9 set to run on all branches
Terraform CI / terraform (push) Failing after 1s
2026-09-30 23:43:40 -07:00
sohcato dba864460c add ci/cd action workflow for terraform deployment 2026-09-30 23:38:20 -07:00
3 changed files with 67 additions and 13 deletions
+50
View File
@@ -0,0 +1,50 @@
name: Terraform CI
run-name: ${{ gitea.actor }} triggered a Terraform CI
on:
push:
pull_request:
jobs:
terraform:
runs-on: infra-terraform
container:
volumes:
- /srv/terraform-state/proxmox-prod:/srv/terraform-state/proxmox-prod"
defaults:
run:
working-directory: stacks/prod/proxmox
env:
# TODO: migrate to Openbao
PROXMOX_VE_ENDPOINT: ${{ secrets.PROXMOX_VE_ENDPOINT }}
PROXMOX_VE_API_TOKEN: ${{ secrets.PROXMOX_VE_API_TOKEN }}
PROXMOX_VE_SSH_PRIVATE_KEY: ${{ secrets.PROXMOX_VE_SSH_PRIVATE_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.13.3
# Job will fail if you didn't run `terraform fmt -recursive`
- name: Check formatting
run: terraform fmt -check -recursive
- name: Initialize Terraform modules
run: terraform init
- name: Validate Terraform
run: terraform validate
- name: Create Terraform plan
run: terraform plan -out=tfplan
# Job will apply the plan if pushed to main
- name: Conditionally apply the Terraform plan
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: terraform apply -auto-approve tfplan
+5 -4
View File
@@ -6,7 +6,7 @@ provider "proxmox" {
endpoint = "https://192.168.30.70:8006"
# API token authentication (through environment variables)
api_token = var.proxmox_api_token
# api_token = var.proxmox_api_token
# Accept self-signed certificates (TODO: change in the future if necessary)
insecure = true
@@ -14,9 +14,10 @@ provider "proxmox" {
# Allow SSH connections for certain operations (like uploading ISO files)
# https://registry.terraform.io/providers/bpg/proxmox/latest/docs#ssh-connection
ssh {
agent = false
username = "svc-terraform"
private_key = file("/home/svc-terraform/.ssh/id_rsa")
agent = false
username = "svc-terraform"
# Read directly from PROXMOX_VE_SSH_PRIVATE_KEY env variable (in Gitea CI/CD)
# private_key = file("/home/svc-terraform/.ssh/id_rsa")
# port = 22
node {
name = "parker"
+12 -9
View File
@@ -1,13 +1,16 @@
variable "proxmox_endpoint" {
description = "Proxmox HTTPS API endpoint (including the port 8006)."
type = string
}
# Comment out only if you need to pass it in as a variable when running not through CI/CD
# Should not be the norm!!!!
variable "proxmox_api_token" {
description = "The API token for Proxmox authentication in the form user@realm!tokenid=token-value"
type = string
sensitive = true # Don't show in console outputs
}
# variable "proxmox_endpoint" {
# description = "Proxmox HTTPS API endpoint (including the port 8006)."
# type = string
# }
#
# variable "proxmox_api_token" {
# description = "The API token for Proxmox authentication in the form user@realm!tokenid=token-value"
# type = string
# sensitive = true # Don't show in console outputs
# }
# variable "username" {
# type = string