mirror of
https://gitlab.durp.info/durfy/homelab/iac.git
synced 2026-05-07 07:50:30 -05:00
add matrix
This commit is contained in:
parent
32d7b0c6f3
commit
9df995d866
3 changed files with 68 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
*/.terraform
|
||||
*/.terraform.lock.hcl
|
||||
.idea
|
||||
|
|
|
|||
10
dmz/main.tf
10
dmz/main.tf
|
|
@ -55,4 +55,14 @@ locals {
|
|||
node = ["mothership"]
|
||||
ip = ["20"]
|
||||
}
|
||||
matrix = {
|
||||
tags = "matrix"
|
||||
count = 1
|
||||
name = ["matrix"]
|
||||
cores = 2
|
||||
memory = "4096"
|
||||
drive = 60
|
||||
node = ["vanguard"]
|
||||
ip = ["21"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
57
dmz/matrix.tf
Normal file
57
dmz/matrix.tf
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
resource "proxmox_vm_qemu" "matrix" {
|
||||
count = local.matrix.count
|
||||
ciuser = "administrator"
|
||||
vmid = "${local.vlan}${local.matrix.ip[count.index]}"
|
||||
name = local.matrix.name[count.index]
|
||||
target_node = local.matrix.node[count.index]
|
||||
clone = local.template
|
||||
tags = local.matrix.tags
|
||||
qemu_os = "l26"
|
||||
full_clone = true
|
||||
os_type = "cloud-init"
|
||||
agent = 1
|
||||
cores = local.matrix.cores
|
||||
sockets = 1
|
||||
cpu_type = "host"
|
||||
memory = local.matrix.memory
|
||||
scsihw = "virtio-scsi-pci"
|
||||
#bootdisk = "scsi0"
|
||||
boot = "order=virtio0"
|
||||
onboot = true
|
||||
sshkeys = local.sshkeys
|
||||
vga {
|
||||
type = "serial0"
|
||||
}
|
||||
serial {
|
||||
id = 0
|
||||
type = "socket"
|
||||
}
|
||||
disks {
|
||||
ide {
|
||||
ide2 {
|
||||
cloudinit {
|
||||
storage = local.storage
|
||||
}
|
||||
}
|
||||
}
|
||||
virtio {
|
||||
virtio0 {
|
||||
disk {
|
||||
size = local.matrix.drive
|
||||
format = local.format
|
||||
storage = local.storage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
network {
|
||||
id = 0
|
||||
model = "virtio"
|
||||
bridge = "vmbr0"
|
||||
tag = local.vlan
|
||||
}
|
||||
#Cloud Init Settings
|
||||
ipconfig0 = "ip=192.168.${local.vlan}.${local.matrix.ip[count.index]}/24,gw=192.168.${local.vlan}.1"
|
||||
searchdomain = "durp.loc"
|
||||
nameserver = local.dnsserver
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue