diff --git a/glusterfs/terraform/jumphost.tf b/glusterfs/terraform/jumphost.tf new file mode 100644 index 0000000..344047b --- /dev/null +++ b/glusterfs/terraform/jumphost.tf @@ -0,0 +1,80 @@ +resource "proxmox_vm_qemu" "cloudinit-test1" { + name = "Jumphost" + 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 = 4 + sockets = 2 + type = "host" + } + memory = 2048 + balloon = 1024 + scsihw = "virtio-scsi-single" + + # Setup the disk + disks { + ide { + ide3 { + cloudinit { + storage = "local-lvm" + } + } + } + scsi { + scsi0 { + disk { + size = "10G" + storage = var.storage_disks + discard = true + iothread = true + # Can't emulate SSDs in virtio + } + } + } + } + + network { + id = 0 + model = "e1000" + bridge = var.nic_name_external + } + + network { + id = 1 + model = "e1000" + bridge = var.nic_name_internal + } + + vga { + type = "virtio" + } + + + startup_shutdown { + order = -1 + shutdown_timeout = -1 + startup_delay = -1 + } + + # 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" + ipconfig1 = "ip=dhcp,ip6=dhcp" + skip_ipv6 = true + + ciuser = "clusteruser" + cipassword = "password" + ciupgrade = true +} \ No newline at end of file diff --git a/glusterfs/terraform/vars.tf b/glusterfs/terraform/vars.tf index 62491da..4b22f87 100644 --- a/glusterfs/terraform/vars.tf +++ b/glusterfs/terraform/vars.tf @@ -10,10 +10,14 @@ variable "storage_disks" { default = "local-lvm" } -variable "nic_name" { +variable "nic_name_external" { default = "vmbr0" } +variable "nic_name_internal" { + default = "testNet" +} + variable "hosts" { type = list(string) default = ["gluster1", "gluster2", "gluster3"]