You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 年之前
12345678910111213141516171819
  1. locals {
  2. vms_with_groups = {
  3. for hostname, host in var.vms: hostname => host if contains(keys(host),"groups")
  4. }
  5. vms_without_groups = {
  6. for hostname, host in var.vms: hostname => host if !contains(keys(host),"groups")
  7. }
  8. vm_groups = distinct(flatten(values(local.vms_with_groups)[*].groups))
  9. vms_with_provider = {
  10. for hostname, host in var.vms: hostname => host if contains(keys(host),"provider")
  11. }
  12. vms_without_provider = {
  13. for hostname, host in var.vms: hostname => host if !contains(keys(host),"provider")
  14. }
  15. vm_providers = distinct(values(local.vms_with_provider)[*].provider)
  16. }