init move to tf modules
All checks were successful
OpenTofu Automation / deploy (push) Successful in 12s

This commit is contained in:
Matt Reeves 2024-11-03 01:38:02 -04:00
parent 832be9fc2b
commit 33984b88a9
18 changed files with 235 additions and 61 deletions

View file

@ -1,12 +1,8 @@
terraform { terraform {
required_providers { required_version = ">= 1.0.0"
proxmox = {
source = "bpg/proxmox"
version = "0.66.3"
}
}
backend "s3" {
backend "s3" {
bucket = "BigBuckets" bucket = "BigBuckets"
region = "us-ashburn-1" region = "us-ashburn-1"
key = "tf.tfstate" key = "tf.tfstate"
@ -24,6 +20,15 @@ terraform {
} }
} }
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
version = "0.66.3"
}
}
}
provider "proxmox" { provider "proxmox" {
endpoint = var.virtual_environment_endpoint endpoint = var.virtual_environment_endpoint
password = var.ssh_password 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
}

View file

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

View file

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

View file

@ -1,71 +1,93 @@
variable "virtual_environment_endpoint" { # Define each required variable
type = string
}
variable "virtual_environment_api" {
type = string
}
variable "arrbuntu_ip_address" { variable "arrbuntu_ip_address" {
type = string description = "IP address for Arrbuntu VM"
} 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
} }
variable "init_username" { variable "init_username" {
type = string description = "Username for initial configuration"
type = string
} }
variable "init_password" { variable "downloaders_ip_address" {
type = string description = "IP address for Downloaders VM"
type = string
} }
variable "kasm_ip" { variable "npm_ip_address" {
type = string description = "IP address for NPM VM"
type = string
}
variable "prox_ip_address" {
description = "IP address for Proxmox server"
type = string
} }
variable "kasm_ssh_ip" { variable "kasm_ssh_ip" {
type = string description = "IP address for Kasm SSH"
} type = string
variable "ubu_ip_address" {
type = string
}
variable "pve2_ip_address" {
type = string
}
variable "s3_endpoint" {
type = string
} }
variable "aws_secret_access_key" { 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" { variable "aws_access_key_id" {
type = string 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
}