Add working provisioning and configuration for MS SQL data warehouse

This commit is contained in:
2026-03-16 13:29:55 +01:00
parent 2eeffc604a
commit ee04f1ff1a
23 changed files with 1100 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
bucket = "cwxbkp1-prod"
key = "proxmox/prod/SMSSQLDW1P/terraform.tfstate"
region = "eu-central"
endpoints = {
s3 = "https://nbg1.your-objectstorage.com"
}
force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
skip_requesting_account_id = true

View File

@@ -0,0 +1,58 @@
terraform {
required_version = ">= 1.6.0"
required_providers {
proxmox = {
source = "bpg/proxmox"
version = "~> 0.73"
}
}
backend "s3" {}
}
provider "proxmox" {
endpoint = var.proxmox_endpoint
insecure = var.proxmox_insecure
api_token = var.proxmox_api_token
ssh {
username = var.proxmox_ssh_user
password = var.proxmox_ssh_password
agent = var.proxmox_ssh_agent
}
}
module "vm" {
source = "../modules/vm"
node_name = var.node_name
vm_id = var.vm_id
name = var.name
description = var.description
tags = var.tags
bios = "ovmf"
os_type = "win11"
cpu_cores = var.cpu_cores
memory_dedicated = var.memory_dedicated
clone_vm_id = var.clone_vm_id
clone_datastore_id = var.clone_datastore_id
init_ipv4_address = var.init_ipv4_address
init_ipv4_gateway = var.init_ipv4_gateway
init_dns_servers = var.init_dns_servers
init_username = var.init_username
admin_password = var.admin_password
cloud_init_datastore = var.cloud_init_datastore
disk_datastore = var.disk_datastore
disk_size = var.disk_size
data_disk_size = var.data_disk_size
data_disk_datastore = var.data_disk_datastore
network_bridge = var.network_bridge
network_vlan_id = var.network_vlan_id
}

View File

@@ -0,0 +1,19 @@
output "vm_id" {
description = "The Proxmox VM ID"
value = module.vm.vm_id
}
output "name" {
description = "The VM hostname"
value = module.vm.name
}
output "ipv4_addresses" {
description = "IPv4 addresses reported by the QEMU agent"
value = module.vm.ipv4_addresses
}
output "mac_addresses" {
description = "MAC addresses of the VM's network interfaces"
value = module.vm.mac_addresses
}

View File

@@ -0,0 +1,27 @@
proxmox_endpoint = "https://proxmox.example.local:8006/api2/json"
proxmox_insecure = true
proxmox_api_token = "packer@pve!packer=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
proxmox_ssh_user = "root"
proxmox_ssh_password = "changeme"
proxmox_ssh_agent = false
node_name = "pve"
vm_id = 200
name = "SMSSQLDW1P"
init_ipv4_address = "10.0.0.100/24"
init_ipv4_gateway = "10.0.0.1"
init_dns_servers = ["10.0.0.2", "10.0.0.3"]
admin_password = "ChangeMe-StrongPassword!"
cpu_cores = 4
memory_dedicated = 16384
disk_size = 80
disk_datastore = "local-lvm"
data_disk_size = 80
data_disk_datastore = "local-lvm"
network_bridge = "vmbr0"
cloud_init_datastore = "local-lvm"
clone_vm_id = 1002

View File

@@ -0,0 +1,152 @@
variable "proxmox_endpoint" {
description = "URL of the Proxmox API (e.g. https://192.168.1.10:8006/)"
type = string
}
variable "proxmox_insecure" {
description = "Skip TLS certificate verification (set true for self-signed certs)"
type = bool
default = false
}
variable "proxmox_api_token" {
description = "Proxmox API token in the form user@realm!tokenid=secret"
type = string
sensitive = true
}
variable "proxmox_ssh_user" {
description = "SSH username for the Proxmox node"
type = string
}
variable "proxmox_ssh_password" {
description = "SSH password for connecting to the Proxmox node"
type = string
sensitive = true
default = null
}
variable "proxmox_ssh_agent" {
description = "Use SSH agent for authentication"
type = bool
default = true
}
variable "node_name" {
description = "Proxmox cluster node name"
type = string
}
variable "vm_id" {
description = "Unique Proxmox VM ID"
type = number
}
variable "name" {
description = "VM hostname"
type = string
}
variable "description" {
description = "VM description"
type = string
default = ""
}
variable "tags" {
description = "Tags to apply to the VM"
type = list(string)
default = []
}
variable "cpu_cores" {
type = number
default = 2
}
variable "memory_dedicated" {
description = "RAM in MB"
type = number
default = 2048
}
variable "clone_vm_id" {
description = "VM ID of the Windows template to clone"
type = number
default = 1002
}
variable "clone_datastore_id" {
description = "Target datastore for the cloned disks (null = keep on source datastore)"
type = string
default = null
}
variable "disk_datastore" {
type = string
default = "local-lvm"
}
variable "disk_size" {
description = "Disk size in GB"
type = number
default = 60
}
variable "data_disk_size" {
description = "Size in GB of the data disk. Set to null to skip."
type = number
default = null
}
variable "data_disk_datastore" {
description = "Proxmox datastore ID for the data disk."
type = string
default = "local-lvm"
}
variable "network_bridge" {
type = string
default = "vmbr11"
}
variable "network_vlan_id" {
type = number
default = null
}
variable "init_ipv4_address" {
description = "IPv4 address in CIDR notation (e.g. 10.10.2.100/24) or dhcp"
type = string
}
variable "init_ipv4_gateway" {
description = "IPv4 gateway address"
type = string
default = null
}
variable "init_dns_servers" {
description = "List of DNS servers for initialization"
type = list(string)
default = []
}
variable "init_username" {
description = "Username for the initial account"
type = string
default = "Administrator"
}
variable "admin_password" {
description = "Password for the initial account"
type = string
sensitive = true
}
variable "cloud_init_datastore" {
description = "Datastore used to store the cloud-init drive"
type = string
default = "local"
}