restructure
This commit is contained in:
parent
e0e84b0c48
commit
f3e0d09774
8 changed files with 4 additions and 0 deletions
64
bootstrap/main.tf
Normal file
64
bootstrap/main.tf
Normal file
|
@ -0,0 +1,64 @@
|
|||
terraform {
|
||||
backend "pg" {
|
||||
schema_name = "bootstrap"
|
||||
}
|
||||
|
||||
required_providers {
|
||||
libvirt = {
|
||||
source = "dmacvicar/libvirt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "libvirt" {
|
||||
uri = var.libvirt_endpoint
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "iso" {
|
||||
name = "iso"
|
||||
type = "dir"
|
||||
path = "/kvm/iso"
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "disk" {
|
||||
name = "disk"
|
||||
type = "dir"
|
||||
path = "/kvm/disk"
|
||||
}
|
||||
|
||||
resource "libvirt_pool" "init" {
|
||||
name = "init"
|
||||
type = "dir"
|
||||
path = "/kvm/init"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "ubuntu_jammy" {
|
||||
name = "ubuntu-jammy.img"
|
||||
pool = "iso"
|
||||
source = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "debian_bullseye" {
|
||||
name = "debian-bullseye.iso"
|
||||
pool = "iso"
|
||||
source = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "debian_bookworm" {
|
||||
name = "debian-bookworm.qcow2"
|
||||
pool = "iso"
|
||||
source = "https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2"
|
||||
}
|
||||
|
||||
resource "libvirt_network" "dmzbr" {
|
||||
name = "dmzbr"
|
||||
mode = "bridge"
|
||||
bridge = "dmzbr"
|
||||
dhcp {
|
||||
enabled = false
|
||||
}
|
||||
dns {
|
||||
enabled = false
|
||||
}
|
||||
autostart = true
|
||||
}
|
4
bootstrap/variables.tf
Normal file
4
bootstrap/variables.tf
Normal file
|
@ -0,0 +1,4 @@
|
|||
variable "libvirt_endpoint" {
|
||||
type = string
|
||||
default = "qemu+ssh://root@atlas.lan/system"
|
||||
}
|
Reference in a new issue