From d4bde8821008e1b67b69a82a06d863369eb25b4f Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Fri, 7 Apr 2023 16:02:02 +0200 Subject: [PATCH] support data disks --- main.tf | 7 +++++++ variables.tf | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/main.tf b/main.tf index 51aa066..429cf67 100644 --- a/main.tf +++ b/main.tf @@ -78,6 +78,13 @@ resource "libvirt_domain" "debian" { volume_id = libvirt_volume.debian.id } + dynamic "disk" { + for_each = var.disks + content { + volume_id = disk.value + } + } + network_interface { bridge = var.bridge_name hostname = var.name diff --git a/variables.tf b/variables.tf index 7dd5a82..ad900ed 100644 --- a/variables.tf +++ b/variables.tf @@ -54,3 +54,8 @@ variable "bridge_name" { variable "ca_host" { type = string } + +variable "data_disks" { + type = list(string) + default = [] +}