From 344f748b84b35001c1abde32b1f3c292395a7dac Mon Sep 17 00:00:00 2001 From: kasun Date: Sun, 22 Nov 2026 18:42:30 +0100 Subject: [PATCH 1/2] enhancement(proxmox-infra): protect resources and stop update reboots Prepare the stack for deploying on merge. Protect templates, DHCP mappings and the Ansible container, and stop in-place updates from rebooting k3s VMs. --- 01-proxmox-infra/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/01-proxmox-infra/index.ts b/01-proxmox-infra/index.ts index c1f0b24..bb84e0f 100644 --- a/01-proxmox-infra/index.ts +++ b/01-proxmox-infra/index.ts @@ -141,7 +141,7 @@ const pveNodes = pveNodeSeeds }, ], }, - { provider: n.provider, ignoreChanges: ["disks"] }, + { provider: n.provider, protect: true, ignoreChanges: ["disks"] }, ), })); @@ -291,7 +291,7 @@ const k3sVms = nodeConfigs.map( agent: { enabled: true, timeout: "30s" }, cdrom: { fileId: "none" }, started: false, - stopOnDestroy: true, + rebootAfterUpdate: false, }, { provider: node.host.provider, @@ -322,7 +322,7 @@ k3sVms.forEach((vmResource, i) => { ipAddress: nodeConfigs[i].ip, hostname: nodeConfigs[i].name, }, - { dependsOn: vmResource, provider: pfSenseProvider }, + { dependsOn: vmResource, provider: pfSenseProvider, protect: true }, ); }); @@ -357,7 +357,7 @@ const ansibleDhcp = new pfsense.Dhcpv4Staticmapping( ipAddress: ansibleIp, hostname: "ansible", }, - { provider: pfSenseProvider }, + { provider: pfSenseProvider, protect: true }, ); new proxmox.ContainerLegacy( // NOSONAR typescript:S1848 @@ -396,6 +396,7 @@ new proxmox.ContainerLegacy( // NOSONAR typescript:S1848 provider: ansibleHost.provider, dependsOn: ansibleDhcp, retainOnDelete: true, + protect: true, }, ); -- 2.54.1 From 9b15ea5d330137880b595381e3f08af49413bdd9 Mon Sep 17 00:00:00 2001 From: kasun Date: Sun, 22 Nov 2026 18:42:30 +0100 Subject: [PATCH 2/2] enhancement(ci): deploy proxmox-infra on merge to main Skip the refresh on automatic deploys. A refresh that finds a VM missing drops it from state, and the following up would create a blank replacement. --- .gitea/workflows/01-deploy-proxmox-infra.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/01-deploy-proxmox-infra.yaml b/.gitea/workflows/01-deploy-proxmox-infra.yaml index 9bc7c03..bb8dda8 100644 --- a/.gitea/workflows/01-deploy-proxmox-infra.yaml +++ b/.gitea/workflows/01-deploy-proxmox-infra.yaml @@ -3,6 +3,13 @@ name: Deploy Proxmox Infra on: workflow_dispatch: + push: + branches: + - main + paths: + - "01-proxmox-infra/**" + - ".gitea/workflows/01-deploy-proxmox-infra.yaml" + pull_request: branches: - main @@ -51,7 +58,7 @@ jobs: deploy: name: Pulumi Deploy runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' steps: - name: Checkout Code uses: actions/checkout@v4 @@ -75,7 +82,10 @@ jobs: run: pulumi package add terraform-provider marshallford/pfsense 0.22.0 working-directory: 01-proxmox-infra + # Manual runs only: a refresh that finds a VM missing drops it from state, + # and `up` would then create a blank replacement without review. - name: Refresh State + if: github.event_name == 'workflow_dispatch' run: | pulumi login "$PULUMI_BACKEND_URL" pulumi refresh --yes --stack dev \ -- 2.54.1