From a04a62c68bf1806783779c0028d250ab53d8ae6f Mon Sep 17 00:00:00 2001 From: Ditmar Visser Date: Fri, 6 Jun 2025 10:38:38 +0000 Subject: [PATCH] fix: remove azure from template --- ...azure.tmpl => ansible-inventory copy.tmpl} | 0 terraform/providers.tf | 18 +++++----- terraform/userdata.tftpl | 19 ----------- terraform/userdata_with_azure.tftpl | 26 ++++++++++++++ terraform/variables.tf | 34 +++++++++---------- 5 files changed, 52 insertions(+), 45 deletions(-) rename terraform/{ansible-inventory_with_azure.tmpl => ansible-inventory copy.tmpl} (100%) create mode 100644 terraform/userdata_with_azure.tftpl diff --git a/terraform/ansible-inventory_with_azure.tmpl b/terraform/ansible-inventory copy.tmpl similarity index 100% rename from terraform/ansible-inventory_with_azure.tmpl rename to terraform/ansible-inventory copy.tmpl diff --git a/terraform/providers.tf b/terraform/providers.tf index 70db5d0..8ff6ad5 100644 --- a/terraform/providers.tf +++ b/terraform/providers.tf @@ -3,10 +3,10 @@ terraform { esxi = { source = "registry.terraform.io/josenk/esxi" } - azurerm = { - source = "hashicorp/azurerm" - version = "~> 4.27.0" - } + # azurerm = { + # source = "hashicorp/azurerm" + # version = "~> 4.27.0" + # } } backend "pg" { conn_str = "postgres://terraform:tfbackend123@192.168.1.4/terraform_state?sslmode=disable" @@ -22,8 +22,8 @@ provider "esxi" { } -provider "azurerm" { - resource_provider_registrations = "none" - subscription_id = var.azure_subscriptionid - features {} -} +# provider "azurerm" { +# resource_provider_registrations = "none" +# subscription_id = var.azure_subscriptionid +# features {} +# } diff --git a/terraform/userdata.tftpl b/terraform/userdata.tftpl index bfbd0a7..b01b28d 100644 --- a/terraform/userdata.tftpl +++ b/terraform/userdata.tftpl @@ -5,22 +5,3 @@ users: - ${skylab-ssh-public-key} shell: /bin/bash sudo: ["ALL=(ALL) NOPASSWD:ALL"] -# write_files: -# - path: /home/testuser/.ssh/azure -# content: | -# ${azure-ssh-private-key} -# permissions: "0600" -# owner: testuser:testuser -# defer: true - -# - path: /home/testuser/.ssh/config -# content: | -# Host azurevm -# HostName ${azure-vm-ip} -# User testuser -# IdentityFile ~/.ssh/azure -# StrictHostKeyChecking no -# UserKnownHostsFile=/dev/null -# permissions: "0600" -# owner: testuser:testuser -# defer: true diff --git a/terraform/userdata_with_azure.tftpl b/terraform/userdata_with_azure.tftpl new file mode 100644 index 0000000..21f4a8e --- /dev/null +++ b/terraform/userdata_with_azure.tftpl @@ -0,0 +1,26 @@ +#cloud-config +users: + - name: testuser + ssh-authorized-keys: + - ${skylab-ssh-public-key} + shell: /bin/bash + sudo: ["ALL=(ALL) NOPASSWD:ALL"] +write_files: + - path: /home/testuser/.ssh/azure + content: | + ${azure-ssh-private-key} + permissions: "0600" + owner: testuser:testuser + defer: true + + - path: /home/testuser/.ssh/config + content: | + Host azurevm + HostName ${azure-vm-ip} + User testuser + IdentityFile ~/.ssh/azure + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null + permissions: "0600" + owner: testuser:testuser + defer: true diff --git a/terraform/variables.tf b/terraform/variables.tf index bd91f1d..a6d8148 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -26,28 +26,28 @@ variable "esxi_password" { sensitive = true } -variable "azure_subscriptionid" { - description = "ID of the Azure Subscription." - sensitive = true -} +# variable "azure_subscriptionid" { +# description = "ID of the Azure Subscription." +# sensitive = true +# } -variable "azure_resourcegroup" { - description = "Name of the Azure Resource Group." -} +# variable "azure_resourcegroup" { +# description = "Name of the Azure Resource Group." +# } -variable "azure_location" { - description = "Location of the Azure resources" - default = "westeurope" -} +# variable "azure_location" { +# description = "Location of the Azure resources" +# default = "westeurope" +# } variable "skylab_ssh_public_key" { description = "Public key for the ESXi VM" } -variable "azure_ssh_public_key" { - description = "Public key for the Azure VM" -} +# variable "azure_ssh_public_key" { +# description = "Public key for the Azure VM" +# } -variable "azure_ssh_private_key" { - description = "Private key of the Azure VM" -} +# variable "azure_ssh_private_key" { +# description = "Private key of the Azure VM" +# }