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

28
tofu/storage/main.tf Normal file
View file

@ -0,0 +1,28 @@
terraform {
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.7.6"
}
}
}
resource "libvirt_pool" "hklbgd" {
name = "hklbgd-guests"
type = "dir"
path = "/var/lib/libvirt/guest_images"
}
resource "libvirt_volume" "fcos" {
name = "fedora-coreos-39.20240210.3.0-qemu.x86_64.qcow2"
pool = libvirt_pool.hklbgd.name
format = "qcow2"
}
output "pool" {
value = libvirt_pool.hklbgd.name
}
output "base_volume_id" {
value = libvirt_volume.fcos.id
}