modularize tf infrastructure
This commit is contained in:
parent
493daeeb29
commit
6dae248c01
14 changed files with 291 additions and 151 deletions
31
tofu/network/main.tf
Normal file
31
tofu/network/main.tf
Normal 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
|
||||
}
|
9
tofu/network/variables.tf
Normal file
9
tofu/network/variables.tf
Normal 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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue