Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

41 rinda
740B

  1. variable "vms" {
  2. default = {}
  3. }
  4. variable "groups" {
  5. default = {}
  6. }
  7. module "vms" {
  8. source = "./modules/vms"
  9. vms = var.vms
  10. groups = var.groups
  11. providers_hostvars = {
  12. hetzner = module.vms_hetzner.hostvars
  13. }
  14. }
  15. output "vms" {
  16. value = {
  17. vms_by_provider = module.vms.vms_by_provider
  18. ansible_inventory = module.vms.ansible_inventory
  19. }
  20. }
  21. variable "hetzner_token" {
  22. default = {}
  23. }
  24. module "vms_hetzner" {
  25. source = "./modules/vms-hetzner"
  26. vms = module.vms.vms_by_provider.hetzner
  27. token = var.hetzner_token
  28. }
  29. resource "local_file" "ansible_inventory" {
  30. content = jsonencode(module.vms.ansible_inventory)
  31. filename = "inventory.vms.json"
  32. file_permission = "0644"
  33. directory_permission = "0755"
  34. }