This commit systematically updates all Terraform configurations, including resources, variables, and labels, to use the more generic `app` designation instead of `swarm`. This improves consistency and decouples the infrastructure naming from a specific container orchestration technology like Docker Swarm.
53 lines
1.4 KiB
HCL
53 lines
1.4 KiB
HCL
output "ansible_inventory_yaml" {
|
|
description = "Ansible inventory in YAML format"
|
|
sensitive = false
|
|
value = yamlencode({
|
|
all = {
|
|
children = {
|
|
app = {
|
|
hosts = {
|
|
for name, server in hcloud_server.app : name => {
|
|
ansible_host = server.ipv4_address
|
|
ansible_user = "root"
|
|
private_ip = local.app_private_ips[name]
|
|
}
|
|
}
|
|
}
|
|
db = {
|
|
hosts = {
|
|
for name, server in hcloud_server.db : name => {
|
|
ansible_host = server.ipv4_address
|
|
ansible_user = "root"
|
|
private_ip = local.db_private_ips[name]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
output "prod_private_ips" {
|
|
description = "Private IPs assigned to prod nodes"
|
|
sensitive = false
|
|
value = {
|
|
app = local.app_private_ips
|
|
db = local.db_private_ips
|
|
}
|
|
}
|
|
|
|
output "prod_public_ips" {
|
|
description = "Public IPv4 addresses of prod nodes"
|
|
sensitive = false
|
|
value = {
|
|
app = { for name, server in hcloud_server.app : name => server.ipv4_address }
|
|
db = { for name, server in hcloud_server.db : name => server.ipv4_address }
|
|
}
|
|
}
|
|
|
|
output "prod_floating_ip" {
|
|
description = "Floating IP for prod app entry point — point DNS A records here"
|
|
sensitive = false
|
|
value = hcloud_floating_ip.app.ip_address
|
|
}
|