tf-ansible-workflow

Terraform/Ansible Workflow for Libvirt
git clone https://git.in0rdr.ch/tf-ansible-workflow.git
Log | Files | Refs | Pull requests |Archive

commit 99c2ca35aafc681a52163ed08b276c720b935190
parent e045a27ee47833d32095d905eeb3d5be14946d17
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Wed, 28 Jul 2021 08:33:22 +0200

output all hosts

Diffstat:
Mlibvirt/terraform/outputs.tf | 4++--
Mlibvirt/terraform/vms.tf | 4++++
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libvirt/terraform/outputs.tf b/libvirt/terraform/outputs.tf @@ -1,9 +1,9 @@ output "inventory" { - value = templatefile("${path.module}/templates/inventory.tpl", { hosts = libvirt_domain.host }) + value = templatefile("${path.module}/templates/inventory.tpl", { hosts = local.all_hosts }) } output "qemu_config" { - value = templatefile("${path.module}/templates/qemu-config.yml.tpl", { hosts = libvirt_domain.host }) + value = templatefile("${path.module}/templates/qemu-config.yml.tpl", { hosts = local.all_hosts }) } output "ssh_private_key" { diff --git a/libvirt/terraform/vms.tf b/libvirt/terraform/vms.tf @@ -1,6 +1,10 @@ # based on the example from: # https://github.com/dmacvicar/terraform-provider-libvirt/tree/master/examples/v0.12/ubuntu +locals { + all_hosts = merge(libvirt_domain.host, libvirt_domain.hosts_type2) +} + # todo: LIBVIRT_DEFAULT_URI does not work? provider "libvirt" { uri = "qemu:///system"