Skip to content

Commit

Permalink
fix: tfnew proxprov
Browse files Browse the repository at this point in the history
  • Loading branch information
henrywhitaker3 committed Feb 1, 2024
1 parent dcbbe81 commit c6c59a8
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .taskfiles/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tasks:
plan:
dir: terraform
cmds:
- terraform plan
- terraform plan {{ .CLI_ARGS }}

apply:
dir: terraform
Expand Down
33 changes: 17 additions & 16 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions terraform/actions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module "actions" {
source = "./vm"

name = "actions"
image = local.ubuntu_22_04
ip = "10.0.0.18"
memory = 2048
cores = 2
nameserver = "1.1.1.1 8.8.8.8"
node = 2
disk_size = "8G"

tags = ["srep", "ubuntu"]
}
28 changes: 14 additions & 14 deletions terraform/db.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module "mariadb-1" {
source = "./vm"

name = "mariadb-1"
image = local.ubuntu_22_04
ip = "10.0.0.15"
cores = 2
memory = 2048
node = 1
name = "mariadb-1"
image = local.ubuntu_22_04
ip = "10.0.0.15"
cores = 2
memory = 2048
node = 1
disk_size = "25G"

tags = [ "database", "ubuntu" ]
tags = ["database", "ubuntu"]
}

module "mariadb-2" {
source = "./vm"

name = "mariadb-2"
image = local.ubuntu_22_04
ip = "10.0.0.16"
cores = 2
memory = 2048
node = 2
name = "mariadb-2"
image = local.ubuntu_22_04
ip = "10.0.0.16"
cores = 2
memory = 2048
node = 2
disk_size = "25G"

tags = [ "database", "ubuntu" ]
tags = ["database", "ubuntu"]
}
56 changes: 28 additions & 28 deletions terraform/k3s.tf
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
module "k3s-control-1" {
source = "./vm"

name = "k3s-control-1"
image = local.ubuntu_22_04
ip = "10.0.0.23"
cores = 3
memory = 12288
node = 1
name = "k3s-control-1"
image = local.ubuntu_22_04
ip = "10.0.0.23"
cores = 3
memory = 12288
node = 1
disk_size = "200G"

tags = [ "control", "k3s", "ubuntu" ]
tags = ["control", "k3s", "ubuntu"]
}

module "k3s-control-2" {
source = "./vm"

name = "k3s-control-2"
image = local.ubuntu_22_04
ip = "10.0.0.22"
cores = 3
memory = 12288
node = 2
name = "k3s-control-2"
image = local.ubuntu_22_04
ip = "10.0.0.22"
cores = 3
memory = 12288
node = 2
disk_size = "200G"

tags = [ "control", "k3s", "ubuntu" ]
tags = ["control", "k3s", "ubuntu"]
}

module "k3s-worker-1" {
source = "./vm"

name = "k3s-worker-1"
image = local.ubuntu_22_04
ip = "10.0.0.20"
cores = 2
memory = 8192
node = 1
name = "k3s-worker-1"
image = local.ubuntu_22_04
ip = "10.0.0.20"
cores = 2
memory = 8192
node = 1
disk_size = "200G"

tags = [ "agent", "k3s", "ubuntu" ]
tags = ["agent", "k3s", "ubuntu"]
}

module "k3s-worker-2" {
source = "./vm"

name = "k3s-worker-2"
image = local.ubuntu_22_04
ip = "10.0.0.21"
cores = 2
memory = 8192
node = 2
name = "k3s-worker-2"
image = local.ubuntu_22_04
ip = "10.0.0.21"
cores = 2
memory = 8192
node = 2
disk_size = "200G"

tags = [ "agent", "k3s", "ubuntu" ]
tags = ["agent", "k3s", "ubuntu"]
}
2 changes: 1 addition & 1 deletion terraform/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
proxmox_host = "10.0.0.150"

ubuntu_22_04 = "ubuntu-22.04-cloud"
ubuntu_22_04 = "ubuntu-22.04-cloud"
}
52 changes: 26 additions & 26 deletions terraform/networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,59 @@ module "pihole" {
memory = 2048
nameserver = "1.1.1.1 8.8.8.8"
node = 2
disk_size = "8G"
disk_size = "8G"

tags = [ "dns", "networking", "ubuntu" ]
tags = ["dns", "networking", "ubuntu"]
}

module "lb-1" {
source = "./vm"

name = "lb-1"
image = local.ubuntu_22_04
ip = "10.0.0.4"
memory = 512
node = 1
name = "lb-1"
image = local.ubuntu_22_04
ip = "10.0.0.4"
memory = 512
node = 1
disk_size = "8G"

tags = [ "lb", "networking", "ubuntu" ]
tags = ["lb", "networking", "ubuntu"]
}

module "lb-2" {
source = "./vm"

name = "lb-2"
image = local.ubuntu_22_04
ip = "10.0.0.5"
memory = 512
node = 2
name = "lb-2"
image = local.ubuntu_22_04
ip = "10.0.0.5"
memory = 512
node = 2
disk_size = "8G"

tags = [ "lb", "networking", "ubuntu" ]
tags = ["lb", "networking", "ubuntu"]
}

module "vpn-1" {
source = "./vm"

name = "vpn-1"
image = local.ubuntu_22_04
ip = "10.0.0.11"
memory = 512
node = 1
name = "vpn-1"
image = local.ubuntu_22_04
ip = "10.0.0.11"
memory = 512
node = 1
disk_size = "8G"

tags = [ "networking", "ubuntu", "vpn" ]
tags = ["networking", "ubuntu", "vpn"]
}

module "vpn-2" {
source = "./vm"

name = "vpn-2"
image = local.ubuntu_22_04
ip = "10.0.0.12"
memory = 512
node = 2
name = "vpn-2"
image = local.ubuntu_22_04
ip = "10.0.0.12"
memory = 512
node = 2
disk_size = "8G"

tags = [ "networking", "ubuntu", "vpn" ]
tags = ["networking", "ubuntu", "vpn"]
}
2 changes: 1 addition & 1 deletion terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "2.9.14"
version = "3.0.1-rc1"
}

digitalocean = {
Expand Down
18 changes: 13 additions & 5 deletions terraform/vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ resource "proxmox_vm_qemu" "vm" {
qemu_os = "other"
additional_wait = 0
clone_wait = 0

disk {
size = var.disk_size
storage = var.disk_storage
type = var.disk_type
vm_state = "running"
cloudinit_cdrom_storage = "local-lvm"

disks {
scsi {
scsi0 {
disk {
size = replace(var.disk_size, "G", "")
storage = var.disk_storage
format = "raw"
}
}
}
}

tags = join(";", var.tags)
Expand Down
5 changes: 0 additions & 5 deletions terraform/vm/varibles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ variable "disk_storage" {
default = "local-lvm"
}

variable "disk_type" {
type = string
default = "scsi"
}

variable "tags" {
type = list(string)
default = []
Expand Down

0 comments on commit c6c59a8

Please sign in to comment.