infrastructure/main.tf

66 lines
1.1 KiB
Terraform
Raw Normal View History

2021-10-17 11:11:52 +02:00
terraform {
required_providers {
proxmox = {
2021-10-17 15:14:29 +02:00
source = "registry.example.com/telmate/proxmox"
2021-10-17 11:11:52 +02:00
}
}
}
provider "proxmox" {
pm_api_url = "https://10.42.42.42:8006/api2/json"
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" {
target_node = "nuc"
description = "NixOS LXC Template"
hostname = "nixos-template"
ostemplate = "local:vztmpl/nixos-unstable-default_156198829_amd64.tar.xz"
ostype = "unmanaged"
unprivileged = true
2021-10-17 15:14:29 +02:00
vmid = "101"
template = true
memory = 1024
2021-10-17 12:04:23 +02:00
features {
nesting = true
}
rootfs {
storage = "local-zfs"
size = "8G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "dhcp"
2021-10-17 15:14:29 +02:00
hwaddr = "22:D7:C1:FF:9D:5F"
2021-10-17 12:04:23 +02:00
}
}
2021-10-17 15:14:29 +02:00
resource "proxmox_lxc" "vault" {
target_node = "nuc"
description = "Vault Secrets Management"
hostname = "vault"
unprivileged = true
vmid = "102"
clone = "101"
memory = 1024
rootfs {
storage = "local-zfs"
size = "8G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "dhcp"
hwaddr = "16:2B:87:55:0C:0C"
}
}