diff --git a/terraform/dhcp.tf b/terraform/dhcp.tf index 5b053473..874f97ee 100644 --- a/terraform/dhcp.tf +++ b/terraform/dhcp.tf @@ -17,7 +17,6 @@ resource "proxmox_lxc" "dhcp" { tag = each.value.vlan_id } ostemplate = each.value.ostemplate - password = var.root_pass rootfs { storage = "ceph" size = each.value.disk_size diff --git a/terraform/test_lxc_instance.tf b/terraform/test_lxc_instance.tf new file mode 100644 index 00000000..ef87e772 --- /dev/null +++ b/terraform/test_lxc_instance.tf @@ -0,0 +1,23 @@ +resource "proxmox_lxc" "basic" { + count = 1 + target_node = "pve1" + hostname = "provisioning-template-${count.index}.magevent.net" + ostemplate = "wowza:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz" + ssh_public_keys = var.common.ssh_public_keys + unprivileged = true + + // Terraform will crash without rootfs defined + rootfs { + storage = "ceph" + size = "8G" + } + + network { + name = "eth0" + ip = "dhcp" + bridge = var.magcloud.bridge_id + gw = var.magcloud.gateway + firewall = var.magcloud.firewall + tag = var.magcloud.vlan_id + } +} diff --git a/terraform/variables.tf b/terraform/variables.tf index cbc1693f..319cbe5e 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -7,11 +7,17 @@ variable "common" { EOT } } - -variable "root_pass" { - type = string +variable "magcloud" { + type = map(string) + default = { + network_interface = "eth0" + bridge_id = "vmbr999" + cidr = "10.101.22.0/24" + gateway = "10.101.22.1" + firewall = true + vlan_id = "22" + } } - variable "dhcp" { type = map(map(string)) default = { @@ -19,16 +25,12 @@ variable "dhcp" { hostname = "dhcp1" target_node = "pve1" vmid = "7007" - memory = "8192" - cores = "4" + memory = "1024" + cores = "1" swap = "512" start = true network_interface = "eth0" - bridge_id = "vmbr999" cidr = "10.101.22.253/24" - gateway = "10.101.22.1" - vlan_id = "22" - firewall = true ostemplate = "wowza:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz" disk_size = "8G" unprivileged = true @@ -37,16 +39,12 @@ variable "dhcp" { hostname = "dhcp2" target_node = "pve2" vmid = "7008" - memory = "8192" - cores = "4" + memory = "1024" + cores = "1" swap = "512" start = true network_interface = "eth0" - bridge_id = "vmbr999" cidr = "10.101.22.254/24" - gateway = "10.101.22.1" - vlan_id = "22" - firewall = true ostemplate = "wowza:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz" disk_size = "8G" unprivileged = true