Add healthchecksio provider and refactor ip-for-host collection
This commit is contained in:
parent
ed51a86935
commit
6fdfd338a1
14 changed files with 147 additions and 49 deletions
modules/infrastructure
|
@ -1,17 +1,38 @@
|
|||
output "hosts" {
|
||||
value = {
|
||||
for subdomain in distinct([for record in ovh_domain_zone_record.server_records : record.subdomain]) :
|
||||
subdomain => {
|
||||
"hostname" = subdomain
|
||||
"fqdn" = "${subdomain}.${ovh_domain_zone_record.server_records["${subdomain}:ipv4"].zone}"
|
||||
for key, host in var.hosts :
|
||||
key => {
|
||||
"hostname" = host.hostname
|
||||
"fqdn" = "${host.hostname}.serguzim.net"
|
||||
"fqdn_vpn" = "${host.hostname}.vpn.serguzim.net"
|
||||
"ipv4_address" = try(
|
||||
ovh_domain_zone_record.server_records["${subdomain}:ipv4"].target,
|
||||
local.server_addresses_separated["${key}:ipv4"].address,
|
||||
null
|
||||
)
|
||||
"ipv6_address" = try(
|
||||
ovh_domain_zone_record.server_records["${subdomain}:ipv6"].target,
|
||||
local.server_addresses_separated["${key}:ipv6"].address,
|
||||
null
|
||||
)
|
||||
|
||||
ipv4_address_vpn = try(
|
||||
local.tailscale_host_addresses_separated["${key}:ipv4"].address,
|
||||
null
|
||||
)
|
||||
ipv6_address_vpn = try(
|
||||
local.tailscale_host_addresses_separated["${key}:ipv6"].address,
|
||||
null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output "healthchecksio" {
|
||||
value = {
|
||||
backup = {
|
||||
for key, check in healthchecksio_check.backup : key => {
|
||||
"id" = check.id
|
||||
"ping_url" = check.ping_url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue