diff options
| author | Kumar Damani <me@kumardamani.net> | 2023-08-11 16:28:54 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2023-08-11 16:28:54 +0000 |
| commit | a8a40383081441ebd3757a501364b9ac45eb421e (patch) | |
| tree | f48b7040615af1bda263faa4d2657636c77ba2a4 /terraform/main.tf | |
| parent | 9bae899e227e4899a5ee629bf305a00a39044bc2 (diff) | |
| parent | 1f321db8949b3aeb80afdd7a94e92b7743c3e275 (diff) | |
Merge branch 'work' into 'main'
Work
See merge request kdam0/home-lab!1
Diffstat (limited to 'terraform/main.tf')
| -rw-r--r-- | terraform/main.tf | 309 |
1 files changed, 309 insertions, 0 deletions
diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..f286985 --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,309 @@ +resource "proxmox_lxc" "minio" { + target_node = "pve" + hostname = "minio" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.minio_password}" + unprivileged = false + cores = 1 + cpulimit = 2 + memory = 2048 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "3G" + } + + features { + mount = "nfs;" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "sites" { + target_node = "pve" + hostname = "sites" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.sites_password}" + unprivileged = true + cores = 1 + cpulimit = 1 + memory = 1024 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "3G" + } + + features { + fuse = true + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "rproxy" { + target_node = "pve" + hostname = "rproxy" + ostemplate = "local:vztmpl/alpine-3.18-default_20230607_amd64.tar.xz" + password = "${var.rproxy_password}" + unprivileged = true + cores = 1 + cpulimit = 1 + memory = 1024 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "2G" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "monitoring" { + target_node = "pve" + hostname = "monitoring" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.monitoring_password}" + unprivileged = false + cores = 1 + cpulimit = 2 + memory = 1024 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "10G" + } + + features { + nesting = true + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "nc_kumar" { + target_node = "pve" + hostname = "nc-kumar" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.nc_kumar_password}" + unprivileged = false + cores = 8 + cpulimit = 8 + memory = 12288 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "15G" + } + + features { + nesting = true + fuse = true + mount = "nfs;" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "plex" { + target_node = "pve" + hostname = "plex" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.plex_password}" + unprivileged = false + cores = 8 + cpulimit = 8 + memory = 4096 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "100G" + } + + features { + nesting = true + fuse = true + mount = "nfs;" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "vault" { + target_node = "pve" + hostname = "vault" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.vault_password}" + unprivileged = true + cores = 1 + cpulimit = 2 + memory = 1024 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "10G" + } + + features { + nesting = true + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "torrents" { + target_node = "pve" + hostname = "torrents" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.torrents_password}" + unprivileged = false + cores = 2 + cpulimit = 2 + memory = 2048 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "100G" + } + + features { + nesting = true + fuse = true + mount = "nfs;" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} + +resource "proxmox_lxc" "med_dl" { + target_node = "pve" + hostname = "med-dl" + ostemplate = "local:vztmpl/debian-12-standard_12.0-1_amd64.tar.zst" + password = "${var.med_dl_password}" + unprivileged = false + cores = 4 + cpulimit = 4 + memory = 2048 + start = true + onboot = true + + ssh_public_keys = <<-EOT + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9ONfhaHpY0bSk3o81H/eEp+UxQ9RCszJ7p3f+rvcpH kdam0@art-sr + EOT + + rootfs { + storage = "local-lvm" + size = "10G" + } + + features { + nesting = true + fuse = true + mount = "nfs;" + } + + network { + name = "eth0" + bridge = "vmbr1" + tag = 30 + ip = "dhcp" + mtu = "1420" + } +} |
