ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit d62dca0a61f717fed3cfb1173198caa1932d9b5d
parent 50832fd9b3fb0b87862b48624c799e1e312e24e4
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Fri, 11 Oct 2019 00:48:51 +0300

libvirt_host: Randomize base volume name

Diffstat:
terraform/infrastructure/modules/libvirt_host/main.tf | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/terraform/infrastructure/modules/libvirt_host/main.tf b/terraform/infrastructure/modules/libvirt_host/main.tf @@ -1,6 +1,11 @@ +resource "random_pet" "random_volume" { + count = (var.volume_source == "" ? 0 : 1) + separator = "_" +} + resource "libvirt_volume" "base_volume" { count = (var.volume_source == "" ? 0 : 1) - name = "base_debian_10_image" + name = "base_volume_${random_pet.random_volume[0].id}" pool = var.storage_pool format = var.volume_format source = var.volume_source