-
Notifications
You must be signed in to change notification settings - Fork 4
/
ConsulJoin.tf
57 lines (42 loc) · 1.28 KB
/
ConsulJoin.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
resource "null_resource" "consul_join_server" {
depends_on = [metal_device.consul_server]
count = var.consul_count
connection {
user = "root"
private_key = file(var.private_key_filename)
host = element(metal_device.consul_server.*.access_public_ipv4, count.index)
}
provisioner "remote-exec" {
inline = [
"consul join ${element(metal_device.consul_server.*.access_private_ipv4, 0)}"
]
}
}
resource "null_resource" "consul_join_fortune" {
depends_on = [metal_device.consul_server]
count = var.fcs_count
connection {
user = "root"
private_key = file(var.private_key_filename)
host = element(metal_device.fcs.*.access_public_ipv4, count.index)
}
provisioner "remote-exec" {
inline = [
"consul join ${element(metal_device.consul_server.*.access_private_ipv4, 0)}"
]
}
}
resource "null_resource" "consul_join_fcc" {
depends_on = [metal_device.consul_server]
count = var.fcc_count
connection {
user = "root"
private_key = file(var.private_key_filename)
host = element(metal_device.fcc.*.access_public_ipv4, count.index)
}
provisioner "remote-exec" {
inline = [
"consul join ${element(metal_device.consul_server.*.access_private_ipv4, 0)}"
]
}
}