WIP: nixos-anywhere for virtual machines
This commit is contained in:
parent
cc809942ef
commit
0bf113fa25
16 changed files with 282 additions and 7 deletions
44
terraform/modules/setup/main.tf
Normal file
44
terraform/modules/setup/main.tf
Normal file
|
@ -0,0 +1,44 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
libvirt = {
|
||||
source = "dmacvicar/libvirt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "images" {
|
||||
name = "images"
|
||||
type = "dir"
|
||||
path = "/var/lib/libvirt/pools/images"
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "cloudinit" {
|
||||
name = "cloudinit"
|
||||
type = "dir"
|
||||
path = "/var/lib/libvirt/pools/cloudinit"
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "disks" {
|
||||
name = "disks"
|
||||
type = "dir"
|
||||
path = "/var/lib/libvirt/pools/disks"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "debian_bookworm" {
|
||||
name = "debian-bookworm.qcow2"
|
||||
pool = libvirt_pool.images.name
|
||||
source = "https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2"
|
||||
}
|
||||
|
||||
resource "libvirt_network" "bridgedmz" {
|
||||
name = "bridgedmz"
|
||||
mode = "bridge"
|
||||
bridge = "bridgedmz"
|
||||
dhcp {
|
||||
enabled = false
|
||||
}
|
||||
dns {
|
||||
enabled = false
|
||||
}
|
||||
autostart = true
|
||||
}
|
Reference in a new issue