Skip to content
Snippets Groups Projects
Commit 6d7ed81a authored by Michael Kennedy's avatar Michael Kennedy 🎱
Browse files

switching systems

parent 54a68027
No related branches found
No related tags found
No related merge requests found
Pipeline #258 failed with stages
......@@ -4,13 +4,12 @@
terraform {
required_providers {
vsphere = {
source = "hashicorp/vsphere"
source = "hashicorp/vsphere"
version = "2.2.0"
}
}
}
provider "vsphere" {
vim_keep_alive = 30
user = var.vsphere_connection.user
......@@ -20,24 +19,22 @@ provider "vsphere" {
# Master VM
module "vsphere_vm_master" {
count = var.master_nodes
source = "../tf-vmware-ubuntu"
provider = vsphere_connection
vm_guest_config = {}
vm_template = {}
vsphere_connection = {}
master_nodes = {}
worker_nodes = {}
count = var.master_nodes
source = "../tf-vmware-ubuntu"
vm_guest_config = var.vm_guest_config
vm_template = var.vm_template
vsphere_connection = var.vsphere_connection
master_nodes = var.master_nodes
worker_nodes = var.worker_nodes
}
# Worker VM
module "vsphere_vm_worker" {
for_each = var.worker_nodes
source = "../tf-vmware-ubuntu"
vm_guest_config = {}
vm_template = {}
vsphere_connection = {}
master_nodes = {}
worker_nodes = {}
for_each = var.worker_nodes
source = "../tf-vmware-ubuntu"
vm_guest_config = var.vm_guest_config
vm_template = var.vm_template
vsphere_connection = var.vsphere_connection
master_nodes = var.master_nodes
worker_nodes = var.worker_nodes
}
# output "master_ips" {
# value = module.vsphere_vm_master[*].ip
# }
output "master_ips" {
value = module.vsphere_vm_master[*].ip
}
# output "worker_ips" {
# value = module.vsphere_vm_worker[*].ip
# }
\ No newline at end of file
output "worker_ips" {
value = module.vsphere_vm_worker[*].ip
}
\ No newline at end of file
......@@ -2,12 +2,13 @@
variable "vsphere_connection" {
description = "vSphere Connection Information"
type = object({
server = string
user = string
password = string
cluster = string
datacenter = string
host = string
server = string
user = string
password = string
cluster = string
datacenter = string
host = string
self_signed = string
})
}
## Object map for template
......@@ -22,8 +23,10 @@ variable "vm_template" {
variable "vm_guest_config" {
description = "VMGuest Configuration"
type = object({
name = string
cpu = number
name_prefix = string
guest_id = string
cpu_sockets = number
cpu_cores = number
memory = number
network = string
datastore = string
......@@ -48,3 +51,4 @@ variable "worker_nodes" {
type = map(string)
description = "List of worker node names and ipv4 addresses for K8s workers"
}
master_cpu = 4
master_cores-per-socket = 1
master_ram = 4096
master_disksize = 100 # in GB
worker_cpu = 4
worker_cores-per-socket = 1
worker_ram = 4096
worker_disksize = 650 # in GB
vm-guest-id = "ubuntu64Guest"
vsphere-unverified-ssl = "true"
vsphere-datacenter = "Datacenter"
vsphere-cluster = "Cluster01"
vm-datastore = "Datastore1_SSD"
vm-network = "VM Network"
vm-domain = "home"
dns_server_list = ["192.168.1.80", "8.8.8.8"]
ipv4_gateway = "192.168.1.254"
ipv4_netmask = "24"
vm-template-name = "Ubuntu-2004-Template-100GB-Thin"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment