|
- locals {
-
- vms_with_groups = {
- for hostname, host in var.vms: hostname => host if contains(keys(host),"groups")
- }
- vms_without_groups = {
- for hostname, host in var.vms: hostname => host if !contains(keys(host),"groups")
- }
- vm_groups = distinct(flatten(values(local.vms_with_groups)[*].groups))
-
- vms_with_provider = {
- for hostname, host in var.vms: hostname => host if contains(keys(host),"provider")
- }
- vms_without_provider = {
- for hostname, host in var.vms: hostname => host if !contains(keys(host),"provider")
- }
- vm_providers = distinct(values(local.vms_with_provider)[*].provider)
-
- }
|