This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
hypervisors/bootstrap/main.tf

72 lines
1.4 KiB
Terraform
Raw Normal View History

2023-03-14 20:49:24 +00:00
terraform {
backend "pg" {
schema_name = "bootstrap"
2023-04-06 20:06:53 +00:00
conn_str = "postgres://terraform@10.42.0.1/terraform_state"
2023-03-14 20:49:24 +00:00
}
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
}
}
}
provider "libvirt" {
2023-04-06 20:06:53 +00:00
uri = "qemu+ssh://root@atlas.lan/system"
2023-03-14 20:49:24 +00:00
}
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"
}
2023-04-05 18:38:35 +00:00
resource "libvirt_pool" "data" {
name = "data"
type = "dir"
path = "/kvm/data"
}
2023-03-14 20:49:24 +00:00
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
}