From 3ee45d2603c8b5c2e5d216e434af80f899d58370 Mon Sep 17 00:00:00 2001 From: Patrick de Ruiter Date: Sat, 1 Nov 2025 23:02:03 +0100 Subject: [PATCH] Fix all TFLint warnings - Added version constraints for vsphere (~> 2.0) and vault (~> 5.0) providers - Added terraform required_version (>= 1.0) - Removed unused variables: domain, esxi_hosts, port_groups - Removed unused data source: vsphere_host - All TFLint checks now pass successfully --- data.tf | 5 ----- provider.tf | 8 ++++++-- variables.tf | 33 --------------------------------- 3 files changed, 6 insertions(+), 40 deletions(-) diff --git a/data.tf b/data.tf index 29d2011..248a8e0 100644 --- a/data.tf +++ b/data.tf @@ -10,8 +10,3 @@ data "vsphere_compute_cluster" "cluster" { name = var.cluster_name datacenter_id = data.vsphere_datacenter.dc.id } - -data "vsphere_host" "host" { - name = "esxi101.bsdserver.lan" - datacenter_id = data.vsphere_datacenter.dc.id -} diff --git a/provider.tf b/provider.tf index 6442cb3..ecf6289 100644 --- a/provider.tf +++ b/provider.tf @@ -1,10 +1,14 @@ terraform { + required_version = ">= 1.0" + required_providers { vsphere = { - source = "vmware/vsphere" + source = "vmware/vsphere" + version = "~> 2.0" } vault = { - source = "hashicorp/vault" + source = "hashicorp/vault" + version = "~> 5.0" } } } diff --git a/variables.tf b/variables.tf index f8c79fb..b301dc8 100644 --- a/variables.tf +++ b/variables.tf @@ -55,36 +55,3 @@ variable "secret_id" { type = string sensitive = true } - -# Domain -variable "domain" { - description = "Domain name" - type = string - default = "" -} - -# ESXi Hosts -variable "esxi_hosts" { - description = "Map of ESXi hosts configuration" - type = map(object({ - name = string - ip_address = string - tags = optional(map(string), {}) - })) - default = {} -} - -# Port Groups -variable "port_groups" { - description = "Map of port groups configuration" - type = map(object({ - vlan_id = number - allow_promiscuous = optional(bool, false) - subnet_address = string - subnet_mask = number - gateway_ip = string - nameserver_id = number - hosts = list(string) - })) - default = {} -}