From 3d9bb2b9535f12864cde3a7fa71514681798c75b Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Fri, 11 Mar 2016 23:04:22 +0100 Subject: new example --- examples/count/libvirt.tf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/count/libvirt.tf diff --git a/examples/count/libvirt.tf b/examples/count/libvirt.tf new file mode 100644 index 00000000..a1911100 --- /dev/null +++ b/examples/count/libvirt.tf @@ -0,0 +1,23 @@ +provider "libvirt" { + uri = "qemu:///system" +} + +resource "libvirt_volume" "opensuse_leap" { + name = "opensuse_leap" + source = "http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2" +} + +resource "libvirt_volume" "volume" { + name = "volume" + base_volume = "${libvirt_volume.opensuse_leap.id}" +# count = 4 +} + +resource "libvirt_domain" "terraform_test" { + name = "terraform_test" + disk { + volume_id = "${element(libvirt_volume.volume.*.id, count.index)}" + } + count = 4 +} + -- cgit v1.2.3