From abf91b0aba6d3539de363c229b0cbb6859cc1420 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Sun, 4 Apr 2021 09:24:46 +0200 Subject: [PATCH] reorganize --- windows/main.tf | 6 +----- windows/terraform.tfvars | 0 windows/windows.tf | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 windows/terraform.tfvars diff --git a/windows/main.tf b/windows/main.tf index badf724..c8df71b 100644 --- a/windows/main.tf +++ b/windows/main.tf @@ -16,15 +16,11 @@ terraform { } } -locals { - windows_machines = { for i in libvirt_domain.win_machine : i.name => i.network_interface.0.addresses[0] } -} - output "machines" { value = local.windows_machines } -resource "local_file" "ansible-inventory" { +resource "local_file" "ansible_inventory" { content = templatefile("${path.module}/templates/inventory", { windows_machines = local.windows_machines, network_domain = var.network_domain }) filename = "ansible/inventory" file_permission = "0644" diff --git a/windows/terraform.tfvars b/windows/terraform.tfvars deleted file mode 100644 index e69de29..0000000 diff --git a/windows/windows.tf b/windows/windows.tf index 236e4e3..d94e775 100644 --- a/windows/windows.tf +++ b/windows/windows.tf @@ -30,3 +30,7 @@ resource "libvirt_domain" "win_machine" { wait_for_lease = true } } + +locals { + windows_machines = { for i in libvirt_domain.win_machine : i.name => i.network_interface.0.addresses[0] } +}