refactor: better ssh key names

This commit is contained in:
2025-05-03 18:17:27 +00:00
parent 68819a8255
commit a0b24ae175
3 changed files with 4 additions and 4 deletions

View File

@@ -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:

View File

@@ -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)
}
}

View File

@@ -2,7 +2,7 @@
users:
- name: skylab
ssh-authorized-keys:
- ${ssh-key}
- ${skylab-ssh-key}
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']