-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathoutputs.tf
26 lines (22 loc) · 819 Bytes
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Print the volume's mount path
# output "volume_mountpoint" {
# value = "/mnt/HC_Volume_${split("HC_Volume_", hcloud_volume.data_volume.linux_device)[1]}"
# }
# output "ipv4_web_address" {
# value = { for s in hcloud_server.web : s.name => s.ipv4_address }
# }
# output "ipv4_accessories_address" {
# value = { for s in hcloud_server.accessories : s.name => s.ipv4_address }
# }
output "ssh_01_web_config" {
value = join("\n", [
for server in hcloud_server.web[*] :
format("Host %s\n HostName %s\n User kamal", server.name, server.ipv4_address)
])
}
output "ssh_02_accessories_config" {
value = join("\n", [
for server in hcloud_server.accessories[*] :
format("Host %s\n HostName %s\n User kamal\n ProxyJump %s", server.name, server.ipv4_address, hcloud_server.web[0].name)
])
}