diff --git a/terraform/provider.tf b/terraform/main.tf similarity index 54% rename from terraform/provider.tf rename to terraform/main.tf index 4366264..5cc586d 100644 --- a/terraform/provider.tf +++ b/terraform/main.tf @@ -1,12 +1,8 @@ terraform { - required_providers { - proxmox = { - source = "bpg/proxmox" - version = "0.66.3" - } - } + required_version = ">= 1.0.0" - backend "s3" { + +backend "s3" { bucket = "BigBuckets" region = "us-ashburn-1" key = "tf.tfstate" @@ -24,6 +20,15 @@ terraform { } } +terraform { + required_providers { + proxmox = { + source = "bpg/proxmox" + version = "0.66.3" + } + } +} + provider "proxmox" { endpoint = var.virtual_environment_endpoint password = var.ssh_password @@ -46,3 +51,26 @@ provider "proxmox" { } } } + +module "proxmox" { + source = "./proxmox" + + virtual_environment_endpoint = var.virtual_environment_endpoint + virtual_environment_api = var.virtual_environment_api + arrbuntu_ip_address = var.arrbuntu_ip_address + vlan_gateway = var.vlan_gateway + downloaders_ip_address = var.downloaders_ip_address + ssh_password = var.ssh_password + ssh_username = var.ssh_username + prox_ip_address = var.prox_ip_address + npm_ip_address = var.npm_ip_address + init_username = var.init_username + init_password = var.init_password + kasm_ip = var.kasm_ip + kasm_ssh_ip = var.kasm_ssh_ip + ubu_ip_address = var.ubu_ip_address + pve2_ip_address = var.pve2_ip_address + s3_endpoint = var.s3_endpoint + aws_secret_access_key = var.aws_secret_access_key + aws_access_key_id = var.aws_access_key_id +} \ No newline at end of file diff --git a/terraform/NAS.tf b/terraform/proxmox/NAS.tf similarity index 100% rename from terraform/NAS.tf rename to terraform/proxmox/NAS.tf diff --git a/terraform/arrbuntu.tf b/terraform/proxmox/arrbuntu.tf similarity index 100% rename from terraform/arrbuntu.tf rename to terraform/proxmox/arrbuntu.tf diff --git a/terraform/cloud-init.tf b/terraform/proxmox/cloud-init.tf similarity index 100% rename from terraform/cloud-init.tf rename to terraform/proxmox/cloud-init.tf diff --git a/terraform/k3s-master.tf b/terraform/proxmox/k3s-master.tf similarity index 100% rename from terraform/k3s-master.tf rename to terraform/proxmox/k3s-master.tf diff --git a/terraform/k3s-master2.tf b/terraform/proxmox/k3s-master2.tf similarity index 100% rename from terraform/k3s-master2.tf rename to terraform/proxmox/k3s-master2.tf diff --git a/terraform/k3s-master3.tf b/terraform/proxmox/k3s-master3.tf similarity index 100% rename from terraform/k3s-master3.tf rename to terraform/proxmox/k3s-master3.tf diff --git a/terraform/kasm.tf b/terraform/proxmox/kasm.tf similarity index 100% rename from terraform/kasm.tf rename to terraform/proxmox/kasm.tf diff --git a/terraform/npm.tf b/terraform/proxmox/npm.tf similarity index 100% rename from terraform/npm.tf rename to terraform/proxmox/npm.tf diff --git a/terraform/proxmox/provider.tf b/terraform/proxmox/provider.tf new file mode 100644 index 0000000..ae230d8 --- /dev/null +++ b/terraform/proxmox/provider.tf @@ -0,0 +1,31 @@ +terraform { + required_providers { + proxmox = { + source = "bpg/proxmox" + version = "0.66.3" + } + } +} + +provider "proxmox" { + endpoint = var.virtual_environment_endpoint + password = var.ssh_password + username = "root@pam" + insecure = true + + ssh { + agent = true + username = "root" + password = var.ssh_password + + node { + name = "prox" + address = var.prox_ip_address + } + + node { + name = "pve2" + address = var.pve2_ip_address + } + } +} diff --git a/terraform/prox-backup-server.tf b/terraform/proxmox/prox-backup-server.tf similarity index 100% rename from terraform/prox-backup-server.tf rename to terraform/proxmox/prox-backup-server.tf diff --git a/terraform/runner.tf b/terraform/proxmox/runner.tf similarity index 100% rename from terraform/runner.tf rename to terraform/proxmox/runner.tf diff --git a/terraform/ubu.tf b/terraform/proxmox/ubu.tf similarity index 100% rename from terraform/ubu.tf rename to terraform/proxmox/ubu.tf diff --git a/terraform/ubuntu-noble-base.tf b/terraform/proxmox/ubuntu-noble-base.tf similarity index 100% rename from terraform/ubuntu-noble-base.tf rename to terraform/proxmox/ubuntu-noble-base.tf diff --git a/terraform/ubuntu-noble-base2.tf b/terraform/proxmox/ubuntu-noble-base2.tf similarity index 100% rename from terraform/ubuntu-noble-base2.tf rename to terraform/proxmox/ubuntu-noble-base2.tf diff --git a/terraform/proxmox/variables.tf b/terraform/proxmox/variables.tf new file mode 100644 index 0000000..2817ae3 --- /dev/null +++ b/terraform/proxmox/variables.tf @@ -0,0 +1,93 @@ +# Define each required variable +variable "arrbuntu_ip_address" { + description = "IP address for Arrbuntu VM" + type = string +} + +variable "init_username" { + description = "Username for initial configuration" + type = string +} + +variable "downloaders_ip_address" { + description = "IP address for Downloaders VM" + type = string +} + +variable "npm_ip_address" { + description = "IP address for NPM VM" + type = string +} + +variable "prox_ip_address" { + description = "IP address for Proxmox server" + type = string +} + +variable "kasm_ssh_ip" { + description = "IP address for Kasm SSH" + type = string +} + +variable "aws_secret_access_key" { + description = "AWS Secret Access Key" + type = string + sensitive = true +} + +variable "vlan_gateway" { + description = "Gateway IP for VLAN" + type = string +} + +variable "virtual_environment_endpoint" { + description = "Endpoint for virtual environment API" + type = string +} + +variable "kasm_ip" { + description = "IP address for Kasm" + type = string +} + +variable "ssh_username" { + description = "Username for SSH access" + type = string +} + +variable "init_password" { + description = "Password for initial configuration" + type = string + sensitive = true +} + +variable "aws_access_key_id" { + description = "AWS Access Key ID" + type = string +} + +variable "pve2_ip_address" { + description = "IP address for PVE2 Proxmox server" + type = string +} + +variable "s3_endpoint" { + description = "Endpoint for S3 storage" + type = string +} + +variable "ubu_ip_address" { + description = "IP address for Ubu VM" + type = string +} + +variable "virtual_environment_api" { + description = "API endpoint for virtual environment" + type = string +} + +variable "ssh_password" { + description = "Password for SSH access" + type = string + sensitive = true +} diff --git a/terraform/windows.tf b/terraform/proxmox/windows.tf similarity index 100% rename from terraform/windows.tf rename to terraform/proxmox/windows.tf diff --git a/terraform/variables.tf b/terraform/variables.tf index 55340df..2817ae3 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -1,71 +1,93 @@ -variable "virtual_environment_endpoint" { - type = string -} - -variable "virtual_environment_api" { - type = string -} - +# Define each required variable variable "arrbuntu_ip_address" { - type = string -} - - variable "vlan_gateway" { - type = string -} - -variable "downloaders_ip_address" { - type = string -} - -variable "ssh_password" { - type = string -} - -variable "ssh_username" { - type = string -} - -variable "prox_ip_address" { - type = string -} - -variable "npm_ip_address" { - type = string + description = "IP address for Arrbuntu VM" + type = string } variable "init_username" { - type = string + description = "Username for initial configuration" + type = string } -variable "init_password" { - type = string +variable "downloaders_ip_address" { + description = "IP address for Downloaders VM" + type = string } -variable "kasm_ip" { - type = string +variable "npm_ip_address" { + description = "IP address for NPM VM" + type = string +} + +variable "prox_ip_address" { + description = "IP address for Proxmox server" + type = string } variable "kasm_ssh_ip" { - type = string -} - -variable "ubu_ip_address" { - type = string -} - -variable "pve2_ip_address" { - type = string -} - -variable "s3_endpoint" { - type = string + description = "IP address for Kasm SSH" + type = string } variable "aws_secret_access_key" { - type = string + description = "AWS Secret Access Key" + type = string + sensitive = true +} + +variable "vlan_gateway" { + description = "Gateway IP for VLAN" + type = string +} + +variable "virtual_environment_endpoint" { + description = "Endpoint for virtual environment API" + type = string +} + +variable "kasm_ip" { + description = "IP address for Kasm" + type = string +} + +variable "ssh_username" { + description = "Username for SSH access" + type = string +} + +variable "init_password" { + description = "Password for initial configuration" + type = string + sensitive = true } variable "aws_access_key_id" { - type = string -} \ No newline at end of file + description = "AWS Access Key ID" + type = string +} + +variable "pve2_ip_address" { + description = "IP address for PVE2 Proxmox server" + type = string +} + +variable "s3_endpoint" { + description = "Endpoint for S3 storage" + type = string +} + +variable "ubu_ip_address" { + description = "IP address for Ubu VM" + type = string +} + +variable "virtual_environment_api" { + description = "API endpoint for virtual environment" + type = string +} + +variable "ssh_password" { + description = "Password for SSH access" + type = string + sensitive = true +}