|
@@ -1,6 +1,10 @@ |
|
|
output "vms_by_provider" { |
|
|
output "vms_by_provider" { |
|
|
value = { |
|
|
value = { |
|
|
|
|
|
|
|
|
|
|
|
for providername in local.vm_providers: providername => { |
|
|
|
|
|
for hostname, host in local.vms_with_provider: |
|
|
|
|
|
hostname => var.vms[hostname] |
|
|
|
|
|
if host.provider == providername |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -23,7 +27,7 @@ output "ansible_inventory" { |
|
|
for providername in local.vm_providers: "provider_${providername}" => { |
|
|
for providername in local.vm_providers: "provider_${providername}" => { |
|
|
hosts = { |
|
|
hosts = { |
|
|
for hostname, host in local.vms_with_provider: |
|
|
for hostname, host in local.vms_with_provider: |
|
|
hostname => var.providers_hostvars[host.provider].hostvars[hostname] |
|
|
|
|
|
|
|
|
hostname => var.providers_hostvars[host.provider][hostname] |
|
|
if host.provider == providername |
|
|
if host.provider == providername |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|