chore: add Terraform config for GlusterFS
This commit is contained in:
67
glusterfs/terraform/glusternode.tf
Normal file
67
glusterfs/terraform/glusternode.tf
Normal file
@@ -0,0 +1,67 @@
|
||||
resource "proxmox_vm_qemu" "cloudinit-test1" {
|
||||
for_each = toset(var.hosts)
|
||||
name = "${each.value}"
|
||||
desc = "A test for using terraform and cloudinit"
|
||||
|
||||
# Node name has to be the same name as within the cluster
|
||||
# this might not include the FQDN
|
||||
target_node = var.proxmox_host
|
||||
|
||||
# The template name to clone this vm from
|
||||
clone = var.template_name
|
||||
|
||||
# Activate QEMU agent for this VM
|
||||
agent = 1
|
||||
|
||||
os_type = "cloud-init"
|
||||
cpu {
|
||||
cores = 2
|
||||
sockets = 1
|
||||
type = "host"
|
||||
}
|
||||
memory = 4096
|
||||
balloon = 1024
|
||||
scsihw = "virtio-scsi-single"
|
||||
|
||||
# Setup the disk
|
||||
disks {
|
||||
ide {
|
||||
ide3 {
|
||||
cloudinit {
|
||||
storage = "local-lvm"
|
||||
}
|
||||
}
|
||||
}
|
||||
scsi {
|
||||
scsi0 {
|
||||
disk {
|
||||
size = "32G"
|
||||
storage = var.storage_disks
|
||||
discard = true
|
||||
iothread = true
|
||||
# Can't emulate SSDs in virtio
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
network {
|
||||
id = 0
|
||||
model = "e1000"
|
||||
bridge = var.nic_name
|
||||
}
|
||||
|
||||
vga {
|
||||
type = "virtio"
|
||||
}
|
||||
|
||||
# Setup the ip address using cloud-init.
|
||||
boot = "order=scsi0"
|
||||
# Keep in mind to use the CIDR notation for the ip.
|
||||
ipconfig0 = "ip=dhcp,ip6=dhcp"
|
||||
skip_ipv6 = true
|
||||
|
||||
ciuser = "clusteruser"
|
||||
cipassword = "password"
|
||||
ciupgrade = true
|
||||
}
|
||||
Reference in New Issue
Block a user