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/terraform/main.tf

180 lines
3.5 KiB
Terraform
Raw Normal View History

2023-03-14 20:49:24 +00:00
terraform {
backend "pg" {
schema_name = "bootstrap"
}
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
}
}
}
provider "libvirt" {
2023-04-26 14:07:06 +00:00
uri = "qemu+ssh://root@atlas.hyp/system"
2023-03-14 20:49:24 +00:00
}
2023-05-03 22:23:19 +00:00
provider "libvirt" {
alias = "jefke"
uri = "qemu+ssh://root@jefke.hyp/system"
}
provider "libvirt" {
alias = "lewis"
uri = "qemu+ssh://root@lewis.hyp/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"
}
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
}
2023-05-03 22:23:19 +00:00
resource "libvirt_pool" "iso_jefke" {
name = "iso"
type = "dir"
path = "/kvm/iso"
provider = libvirt.jefke
}
resource "libvirt_pool" "disk_jefke" {
name = "disk"
type = "dir"
path = "/kvm/disk"
provider = libvirt.jefke
}
resource "libvirt_pool" "init_jefke" {
name = "init"
type = "dir"
path = "/kvm/init"
provider = libvirt.jefke
}
resource "libvirt_volume" "ubuntu_jammy_jefke" {
name = "ubuntu-jammy.img"
pool = "iso"
source = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
provider = libvirt.jefke
}
resource "libvirt_volume" "debian_bullseye_jefke" {
name = "debian-bullseye.iso"
pool = "iso"
source = "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2"
provider = libvirt.jefke
}
resource "libvirt_volume" "debian_bookworm_jefke" {
name = "debian-bookworm.qcow2"
pool = "iso"
source = "https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2"
provider = libvirt.jefke
}
resource "libvirt_network" "dmzbr_jefke" {
name = "dmzbr"
mode = "bridge"
bridge = "dmzbr"
dhcp {
enabled = false
}
dns {
enabled = false
}
autostart = true
provider = libvirt.jefke
}
resource "libvirt_pool" "iso_lewis" {
name = "iso"
type = "dir"
path = "/kvm/iso"
provider = libvirt.lewis
}
resource "libvirt_pool" "disk_lewis" {
name = "disk"
type = "dir"
path = "/kvm/disk"
provider = libvirt.lewis
}
resource "libvirt_pool" "init_lewis" {
name = "init"
type = "dir"
path = "/kvm/init"
provider = libvirt.lewis
}
2023-06-17 10:54:41 +00:00
resource "libvirt_pool" "data_lewis" {
name = "data"
type = "dir"
path = "/kvm/data"
provider = libvirt.lewis
}
resource "libvirt_volume" "debian_bookworm_lewis" {
name = "debian-bookworm.qcow2"
pool = "iso"
source = "https://cloud.debian.org/images/cloud/bookworm/daily/latest/debian-12-generic-amd64-daily.qcow2"
provider = libvirt.lewis
}
resource "libvirt_network" "dmzbr_lewis" {
name = "dmzbr"
mode = "bridge"
bridge = "dmzbr"
dhcp {
enabled = false
}
dns {
enabled = false
}
autostart = true
provider = libvirt.lewis
}