Skip to content

Commit 476095b

Browse files
committed
examples: Add new pool resource to Ubuntu example
1 parent 9f00f3d commit 476095b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/ubuntu/ubuntu-example.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ provider "libvirt" {
33
uri = "qemu:///system"
44
}
55

6+
resource "libvirt_pool" "ubuntu" {
7+
name = "ubuntu"
8+
type = "dir"
9+
path = "/tmp/terraform-provider-libvirt-pool-ubuntu"
10+
}
11+
612
# We fetch the latest ubuntu release image from their mirrors
713
resource "libvirt_volume" "ubuntu-qcow2" {
814
name = "ubuntu-qcow2"
9-
pool = "default"
15+
pool = "${libvirt_pool.ubuntu.name}"
1016
source = "https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
1117
format = "qcow2"
1218
}
@@ -27,6 +33,7 @@ resource "libvirt_cloudinit_disk" "commoninit" {
2733
name = "commoninit.iso"
2834
user_data = "${data.template_file.user_data.rendered}"
2935
network_config = "${data.template_file.network_config.rendered}"
36+
pool = "${libvirt_pool.ubuntu.name}"
3037
}
3138

3239
# Create the machine

0 commit comments

Comments
 (0)