From 666ae202fb873f44a9470eabeb0b74129418a901 Mon Sep 17 00:00:00 2001 From: Sebastian Serfling Date: Fri, 8 May 2026 15:05:56 +0200 Subject: [PATCH] fix: ssh-public-keys als datei statt string --- terraform/main.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index 673c091..8e7c3c8 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -16,9 +16,13 @@ provider "proxmox" { # Create staging LXC mit pct-Befehl resource "null_resource" "staging_lxc" { + # SSH Public Key in Datei schreiben + provisioner "local-exec" { + command = "mkdir -p /tmp/terraform && echo '${var.ssh_public_key}' > /tmp/terraform/staging_key.pub" + } + provisioner "local-exec" { command = <<-EOT - set -x pct create 200 \ ${var.lxc_ostemplate} \ --hostname hugo-staging \ @@ -30,7 +34,7 @@ resource "null_resource" "staging_lxc" { --unprivileged 1 \ --start 1 \ --password "${var.root_password}" \ - --ssh-public-keys "${var.ssh_public_key}" + --ssh-public-keys /tmp/terraform/staging_key.pub EOT }