terraform fmt

This commit is contained in:
MichaelFisher1997 2025-04-17 16:54:21 +01:00
parent 72f0080660
commit c430a206c3
2 changed files with 7 additions and 4 deletions

View File

@ -4,7 +4,7 @@ data "template_file" "cloud_init_alpaca" {
template = file("${path.module}/files/cloud_init.yaml") template = file("${path.module}/files/cloud_init.yaml")
vars = { vars = {
ssh_key = file("~/.ssh/id_ed25519.pub") ssh_key = var.ssh_key
hostname = "alpaca-${count.index + 1}" hostname = "alpaca-${count.index + 1}"
domain = "home.arpa" domain = "home.arpa"
tailscale_key = var.tailscale_key tailscale_key = var.tailscale_key
@ -23,7 +23,6 @@ resource "null_resource" "upload_cloud_init_alpaca" {
connection { connection {
type = "ssh" type = "ssh"
user = "root" user = "root"
private_key = file("~/.ssh/id_ed25519")
host = var.target_node host = var.target_node
} }
@ -39,7 +38,7 @@ data "template_file" "cloud_init_llama" {
template = file("${path.module}/files/cloud_init.yaml") template = file("${path.module}/files/cloud_init.yaml")
vars = { vars = {
ssh_key = file("~/.ssh/id_ed25519.pub") ssh_key = var.ssh_key
hostname = "llama-${count.index + 1}" hostname = "llama-${count.index + 1}"
domain = "home.arpa" domain = "home.arpa"
tailscale_key = var.tailscale_key tailscale_key = var.tailscale_key
@ -58,7 +57,6 @@ resource "null_resource" "upload_cloud_init_llama" {
connection { connection {
type = "ssh" type = "ssh"
user = "root" user = "root"
private_key = file("~/.ssh/id_ed25519")
host = var.target_node host = var.target_node
} }

View File

@ -79,3 +79,8 @@ variable "tailscale_key" {
description = "Tailscale auth key" description = "Tailscale auth key"
} }
variable "ssh_key" {
type = string
description = "Public SSH key used by cloud-init"
}