add new parameters and hosts

This commit is contained in:
2026-09-07 19:53:00 +00:00
parent 5d9c2d4d8a
commit 9402af23bb
3 changed files with 159 additions and 134 deletions
+1
View File
@@ -1,3 +1,4 @@
.terraform .terraform
.terraform.lock.hcl .terraform.lock.hcl
terraform.tfvars terraform.tfvars
*.tfstate
+6 -6
View File
@@ -2,20 +2,20 @@ terraform {
required_providers { required_providers {
proxmox = { proxmox = {
source = "bpg/proxmox" source = "bpg/proxmox"
version = "0.111.0" version = "0.111.1"
} }
} }
backend "http" { backend "http" {
address = "https://gitea.oyacoi.ru/api/packages/pyrschtjag/terraform/state/runner" address = "http://10.1.0.104:3000/api/packages/pyrschtjag/terraform/state/runner"
lock_address = "https://gitea.oyacoi.ru/api/packages/pyrschtjag/terraform/state/runner/lock" lock_address = "http://10.1.0.104:3000/api/packages/pyrschtjag/terraform/state/runner/lock"
unlock_address = "https://gitea.oyacoi.ru/api/packages/pyrschtjag/terraform/state/runner/lock" unlock_address = "http://10.1.0.104:3000/api/packages/pyrschtjag/terraform/state/runner/lock"
lock_method = "POST" lock_method = "POST"
unlock_method = "DELETE" unlock_method = "DELETE"
} }
} }
provider "proxmox" { provider "proxmox" {
endpoint = "https://firebat.lan:8006/" endpoint = "https://10.1.0.4:8006/"
username = "root@pam" username = "root@pam"
password = var.proxmox_root_password password = var.proxmox_root_password
insecure = true insecure = true
@@ -37,7 +37,7 @@ locals {
} }
] : [] ] : []
ip = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.${v.vmid % 100}" ip = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.${v.vmid % 100}/24"
gw = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.1" gw = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.1"
nameserver = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.1" nameserver = v.ip == "" ? null : "10.${floor(v.vmid / 100) % 100}.0.1"
+30 -6
View File
@@ -16,7 +16,7 @@ variable "containers" {
started = optional(bool, true) started = optional(bool, true)
start_on_boot = optional(bool, true) start_on_boot = optional(bool, true)
unprivileged = optional(bool, true) unprivileged = optional(bool, true)
ip = optional(string) ip = optional(string, null)
gw = optional(string) gw = optional(string)
nameserver = optional(string) nameserver = optional(string)
tags = optional(list(string), []) tags = optional(list(string), [])
@@ -61,15 +61,15 @@ variable "containers" {
}) })
})) }))
default = { default = {
"router-test" = { "router" = {
vmid = 100 vmid = 101
memory = 1024 memory = 1024
swap = 128 swap = 128
cores = 1 cores = 1
size = 1 size = 2
tags = ["main"] tags = ["main"]
started = false started = true
start_on_boot = false start_on_boot = true
ip = "" ip = ""
networks = [ networks = [
{ {
@@ -77,12 +77,14 @@ variable "containers" {
bridge = "vmbr0" bridge = "vmbr0"
firewall = false firewall = false
vlan_id = 0 vlan_id = 0
hwaddr = "bc:24:11:2f:fa:f6"
}, },
{ {
name = "eth1" name = "eth1"
bridge = "vmbr1" bridge = "vmbr1"
firewall = false firewall = false
vlan_id = 0 vlan_id = 0
hwaddr = "bc:24:11:dd:b3:08"
} }
] ]
operating_system = { operating_system = {
@@ -90,6 +92,28 @@ variable "containers" {
template_file_id = "local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst" template_file_id = "local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst"
} }
} }
"steamcmd" = {
vmid = 1203
memory = 6144
swap = 128
cores = 8
size = 2
tags = ["games"]
started = true
start_on_boot = true
networks = [
{
vlan_id = 12
}
]
operating_system = {
type = "debian",
template_file_id = "local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst"
}
mount_point = [
{ volume= "/rpool/data/steamcmd/", path = "/mnt/steamcmd/" }
]
}
#"GITEA-TEST" = { #"GITEA-TEST" = {
# vmid = 1012 # vmid = 1012
# memory = 2048 # memory = 2048