terraform-libvirt/persitent/libvirtd_base.tf
2020-07-28 23:45:32 +02:00

39 lines
983 B
HCL

# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r
terraform {
required_version = ">= 0.12"
required_providers {
libvirt = ">= 0.0.0"
}
}
provider "libvirt" {
uri = "qemu+tcp://127.0.0.1/system"
# uri = "qemu+ssh://root@192.168.100.10/system"
}
resource "libvirt_pool" "pool_1" {
name = "pool_1"
type = "dir"
path = "/var/lib/libvirt/pool"
}
# -------- volume disk --------
# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/volume.html.markdown
resource "libvirt_volume" "centos7_qcow2" {
name = "centos7.qcow2"
pool = "default"
source = "https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2"
format = "qcow2"
}
resource "libvirt_volume" "debian_buster_qcow2" {
name = "debian-buster.qcow2"
pool = "default"
source = "https://cdimage.debian.org/cdimage/openstack/current/debian-10.4.3-20200610-openstack-amd64.qcow2"
format = "qcow2"
}