modularize tf infrastructure

This commit is contained in:
Vladan Popovic 2024-03-01 16:34:20 +01:00
parent 493daeeb29
commit 6dae248c01
14 changed files with 291 additions and 151 deletions

31
tofu/network/main.tf Normal file
View file

@ -0,0 +1,31 @@
terraform {
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.7.6"
}
}
}
resource "libvirt_network" "hklbgd" {
name = "hklbgd-guests"
mode = "nat"
domain = var.domain
autostart = true
addresses = var.subnet
dns {
enabled = true
local_only = true
}
}
output "id" {
value = libvirt_network.hklbgd.id
}
output "domain" {
value = var.domain
}

View file

@ -0,0 +1,9 @@
variable "subnet" {
type = list(string)
default = ["10.117.3.0/24"]
}
variable "domain" {
type = string
default = "proxmox-coreos.hklbgd.org"
}