41 lines
898 B
Terraform
41 lines
898 B
Terraform
|
terraform {
|
||
|
backend "pg" {
|
||
|
schema_name = "thecloud"
|
||
|
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" {
|
||
|
alias = "lewis"
|
||
|
uri = "qemu+ssh://root@lewis.hyp/system?known_hosts=/etc/ssh/ssh_known_hosts"
|
||
|
}
|
||
|
|
||
|
module "setup_lewis" {
|
||
|
source = "../../../terraform_modules/setup"
|
||
|
providers = {
|
||
|
libvirt = libvirt.lewis
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module "thecloud" {
|
||
|
source = "../../../terraform_modules/debian"
|
||
|
name = "thecloud"
|
||
|
ram = 1024
|
||
|
storage = 25
|
||
|
mac = "CA:FE:C0:FF:EE:0A"
|
||
|
data_disk = "/mnt/data/volumes/thecloud-data.qcow2"
|
||
|
providers = {
|
||
|
libvirt = libvirt.lewis
|
||
|
}
|
||
|
|
||
|
depends_on = [ module.setup_lewis ]
|
||
|
}
|