From a0b24ae1757bc03c9acbdd20e83c5f4f1f6f0277 Mon Sep 17 00:00:00 2001 From: Ditmar Visser Date: Sat, 3 May 2025 18:17:27 +0000 Subject: [PATCH] refactor: better ssh key names --- week-2/opdracht-2/cloudinit-azure.yaml | 2 +- week-2/opdracht-2/main.tf | 4 ++-- week-2/opdracht-2/userdata.tftpl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/week-2/opdracht-2/cloudinit-azure.yaml b/week-2/opdracht-2/cloudinit-azure.yaml index f711e8c..4fba5f9 100644 --- a/week-2/opdracht-2/cloudinit-azure.yaml +++ b/week-2/opdracht-2/cloudinit-azure.yaml @@ -4,7 +4,7 @@ local-hostname: vm-host-naam users: - name: iac ssh-authorized-keys: - - ${ssh-key} + - ${azure-ssh-key} shell: /bin/bash write_files: diff --git a/week-2/opdracht-2/main.tf b/week-2/opdracht-2/main.tf index e740c3d..284c5fa 100644 --- a/week-2/opdracht-2/main.tf +++ b/week-2/opdracht-2/main.tf @@ -20,7 +20,7 @@ data "local_file" "azure_private_key" { data "template_file" "esxi_userdata" { template = file("${path.module}/userdata.tftpl") vars = { - ssh-key = trimspace(data.local_file.ssh_key.content) + skylab-ssh-key = trimspace(data.local_file.ssh_key.content) azure-private-key = indent(6, trimspace(data.local_file.azure_private_key.content)) azure-vm-ip = azurerm_linux_virtual_machine.main.public_ip_address } @@ -151,7 +151,7 @@ resource "azurerm_network_interface_security_group_association" "main" { data "template_file" "azure_cloudinit" { template = file("${path.module}/cloudinit-azure.yaml") vars = { - ssh-key = trimspace(data.azurerm_ssh_public_key.azure.public_key) + azure-ssh-key = trimspace(data.azurerm_ssh_public_key.azure.public_key) } } diff --git a/week-2/opdracht-2/userdata.tftpl b/week-2/opdracht-2/userdata.tftpl index 7e2403d..007211d 100644 --- a/week-2/opdracht-2/userdata.tftpl +++ b/week-2/opdracht-2/userdata.tftpl @@ -2,7 +2,7 @@ users: - name: skylab ssh-authorized-keys: - - ${ssh-key} + - ${skylab-ssh-key} shell: /bin/bash sudo: ['ALL=(ALL) NOPASSWD:ALL']