33 lines
732 B
Terraform
33 lines
732 B
Terraform
|
terraform {
|
||
|
backend "pg" {
|
||
|
schema_name = "thecloud-data"
|
||
|
conn_str = "postgresql://terraform@jefke.hyp/terraformstates"
|
||
|
}
|
||
|
|
||
|
required_providers {
|
||
|
libvirt = {
|
||
|
source = "dmacvicar/libvirt"
|
||
|
version = "0.7.1" # https://github.com/dmacvicar/terraform-provider-libvirt/issues/1040
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# https://libvirt.org/uri.html#libssh-and-libssh2-transport
|
||
|
provider "libvirt" {
|
||
|
uri = "qemu+ssh://root@lewis.hyp/system?known_hosts=/etc/ssh/ssh_known_hosts"
|
||
|
}
|
||
|
|
||
|
module "data_pool" {
|
||
|
source = "../../../terraform_modules/setup/data"
|
||
|
}
|
||
|
|
||
|
resource "libvirt_volume" "data" {
|
||
|
name = "thecloud-data.qcow2"
|
||
|
pool = "data"
|
||
|
size = 1024 * 1024 * 1024 * 150
|
||
|
}
|
||
|
|
||
|
output "data_disk_id" {
|
||
|
value = libvirt_volume.data.id
|
||
|
}
|