|
- output "vms_by_provider" {
- value = {
-
- }
- }
-
- output "ansible_inventory" {
- value = {
- all = {
- hosts = {
- for hostname,host in var.vms: hostname => {}
- }
- children = merge(
- {
- for group in local.vm_groups: group => {
- hosts = {
- for hostname, host in local.vms_with_groups:
- hostname => {}
- if contains(host.groups,group)
- }
- }
- },{
- for providername in local.vm_providers: "provider_${providername}" => {
- hosts = {
- for hostname, host in local.vms_with_provider:
- hostname => var.providers_hostvars[host.provider].hostvars[hostname]
- if host.provider == providername
- }
- }
- }
- )
- }
- }
- }
|