infrastructure/terraform/main.tf

68 lines
1.3 KiB
Terraform
Raw Normal View History

2021-10-17 11:11:52 +02:00
provider "proxmox" {
2021-11-03 22:47:44 +01:00
pm_api_url = "https://10.42.42.42:8006/api2/json"
pm_user = data.vault_generic_secret.proxmox_auth.data["user"]
pm_password = data.vault_generic_secret.proxmox_auth.data["pass"]
2021-10-17 12:04:23 +02:00
pm_tls_insecure = true
2021-10-17 11:11:52 +02:00
}
2021-10-17 12:04:23 +02:00
# For full info see: https://blog.xirion.net/posts/nixos-proxmox-lxc/
resource "proxmox_lxc" "nixos-template" {
2021-11-03 22:47:44 +01:00
target_node = "nuc"
description = "NixOS LXC Template"
hostname = "nixos-template"
ostemplate = "local:vztmpl/nixos-unstable-default_156198829_amd64.tar.xz"
ostype = "unmanaged"
2021-10-17 12:04:23 +02:00
unprivileged = true
2021-11-21 14:05:15 +01:00
vmid = 101
2021-11-03 22:47:44 +01:00
template = true
2021-10-17 15:14:29 +02:00
memory = 1024
2021-10-17 12:04:23 +02:00
features {
nesting = true
}
rootfs {
storage = "local-zfs"
2021-11-03 22:47:44 +01:00
size = "8G"
2021-10-17 12:04:23 +02:00
}
network {
2021-11-03 22:47:44 +01:00
name = "eth0"
2021-10-17 12:04:23 +02:00
bridge = "vmbr0"
2021-11-03 22:47:44 +01:00
ip = "dhcp"
2021-11-23 22:33:05 +01:00
ip6 = "auto"
2021-10-17 15:14:29 +02:00
hwaddr = "22:D7:C1:FF:9D:5F"
2021-10-17 12:04:23 +02:00
}
}
2021-11-23 22:33:05 +01:00
resource "proxmox_lxc" "nixos-template-2" {
2021-11-03 22:47:44 +01:00
target_node = "nuc"
2021-11-23 22:33:05 +01:00
description = "NixOS LXC Template"
hostname = "nixos-template"
ostype = "unmanaged"
2021-10-23 12:54:20 +02:00
unprivileged = true
2021-11-23 22:33:05 +01:00
vmid = 108
template = true
cores = 1
2021-10-19 02:02:56 +02:00
memory = 512
rootfs {
storage = "local-zfs"
2021-11-03 22:47:44 +01:00
size = "8G"
2021-10-19 02:02:56 +02:00
}
2021-11-23 22:33:05 +01:00
features {
nesting = true
2021-11-03 22:47:44 +01:00
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "dhcp"
2021-11-23 22:33:05 +01:00
ip6 = "auto"
hwaddr = "FA:71:3F:31:34:41"
2021-10-17 21:02:10 +02:00
}
}