您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

16 行
513B

  1. output "hostvars" {
  2. value = {
  3. for hostname, host in var.vms: hostname =>
  4. {
  5. external_ip = hcloud_server.vms[hostname].ipv4_address
  6. ansible_host = hcloud_server.vms[hostname].ipv4_address
  7. #internal_ip = hcloud_server_network.vms[hostname].ip
  8. volumes = {
  9. for volumename, volume in lookup(host, "volumes", {}): volumename => merge(volume,{
  10. device = hcloud_volume.volumes["${hostname}--${volumename}"].linux_device
  11. })
  12. }
  13. }
  14. }
  15. }