From c430a206c30d624ee5d0e0f92db9c2b1c53099ab Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Thu, 17 Apr 2025 16:54:21 +0100 Subject: [PATCH] terraform fmt --- terraform/cloud-init.tf | 6 ++---- terraform/variables.tf | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/terraform/cloud-init.tf b/terraform/cloud-init.tf index fa8fbbe..ae472a0 100644 --- a/terraform/cloud-init.tf +++ b/terraform/cloud-init.tf @@ -4,7 +4,7 @@ data "template_file" "cloud_init_alpaca" { template = file("${path.module}/files/cloud_init.yaml") vars = { - ssh_key = file("~/.ssh/id_ed25519.pub") + ssh_key = var.ssh_key hostname = "alpaca-${count.index + 1}" domain = "home.arpa" tailscale_key = var.tailscale_key @@ -23,7 +23,6 @@ resource "null_resource" "upload_cloud_init_alpaca" { connection { type = "ssh" user = "root" - private_key = file("~/.ssh/id_ed25519") host = var.target_node } @@ -39,7 +38,7 @@ data "template_file" "cloud_init_llama" { template = file("${path.module}/files/cloud_init.yaml") vars = { - ssh_key = file("~/.ssh/id_ed25519.pub") + ssh_key = var.ssh_key hostname = "llama-${count.index + 1}" domain = "home.arpa" tailscale_key = var.tailscale_key @@ -58,7 +57,6 @@ resource "null_resource" "upload_cloud_init_llama" { connection { type = "ssh" user = "root" - private_key = file("~/.ssh/id_ed25519") host = var.target_node } diff --git a/terraform/variables.tf b/terraform/variables.tf index 5467e7f..6369347 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -79,3 +79,8 @@ variable "tailscale_key" { description = "Tailscale auth key" } +variable "ssh_key" { + type = string + description = "Public SSH key used by cloud-init" +} +