aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2016-03-11 23:04:22 +0100
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2016-03-11 23:04:22 +0100
commit3d9bb2b9535f12864cde3a7fa71514681798c75b (patch)
treed7413e796f979ab356484ec0763e881d062c66b7
parentf4cfd935e5a24b011ac8de9abe44ffabd52313f7 (diff)
downloadterraform-provider-libvirt-3d9bb2b9535f12864cde3a7fa71514681798c75b.tar
terraform-provider-libvirt-3d9bb2b9535f12864cde3a7fa71514681798c75b.tar.gz
new example
-rw-r--r--examples/count/libvirt.tf23
1 files changed, 23 insertions, 0 deletions
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
+}
+