Skip to content

Commit

Permalink
#36 network.magcloud global vars, reduced dhcp resource allocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsaderholm committed Jun 29, 2021
1 parent 8b22626 commit 09adc6c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
8 changes: 4 additions & 4 deletions terraform/dhcp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ resource "proxmox_lxc" "dhcp" {
start = each.value.start
network {
name = each.value.network_interface
bridge = each.value.bridge_id
ip = each.value.cidr
gw = each.value.gateway
firewall = each.value.firewall
tag = each.value.vlan_id
bridge = var.network.magcloud.bridge_id
gw = var.network.magcloud.gateway
firewall = var.network.magcloud.firewall
tag = var.network.magcloud.vlan_id
}
ostemplate = each.value.ostemplate
password = var.root_pass
Expand Down
30 changes: 18 additions & 12 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ variable "common" {
}
}

variable "network" {
type = map(string)
default = {
magcloud = {
network_interface = "eth0"
bridge_id = "vmbr999"
cidr = "10.101.22.0/24"
gateway = "10.101.22.1"
firewall = true
vlan_id = "22"
}
}
}

variable "root_pass" {
type = string
}
Expand All @@ -19,16 +33,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
Expand All @@ -37,16 +47,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
Expand Down

0 comments on commit 09adc6c

Please sign in to comment.