Skip to content

Commit

Permalink
#35 #36 (#37)
Browse files Browse the repository at this point in the history
* cleanup: removed epochs from README.md

* #36 network.magcloud global vars, reduced dhcp resource allocation.

* #35 template container for Ansible target

* fix: remove var.root_pass to pass lint checks

* Removed other line for lint checks

* variables.tf fix from Cody

* fix: variable names

* fix: variable name revert, formatting cleanup, validation

Co-authored-by: claughinghouse <[email protected]>
  • Loading branch information
aaronsaderholm and claughinghouse authored Jun 29, 2021
1 parent a8da10b commit 8731222
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
1 change: 0 additions & 1 deletion terraform/dhcp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions terraform/test_lxc_instance.tf
Original file line number Diff line number Diff line change
@@ -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
}
}
30 changes: 14 additions & 16 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@ 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 = {
dhcp1 = {
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 +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
Expand Down

0 comments on commit 8731222

Please sign in to comment.