-
Notifications
You must be signed in to change notification settings - Fork 0
/
bridge.tf
63 lines (51 loc) · 1.43 KB
/
bridge.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
58
59
60
61
62
63
resource "null_resource" init_bridge {
count = var.node_type == "bridge" ? 1 : 0
triggers = {
init_bridge = local.init_bridge
}
connection {
user = var.ssh_host_user
private_key = file(var.ssh_host_private_key_file)
host = var.ssh_host_ip
port = var.ssh_host_port
}
provisioner "remote-exec" {
inline = [ local.init_bridge ]
}
depends_on = [ null_resource.install_app, ]
}
resource "null_resource" snapshot_bridge {
count = var.node_type == "bridge" ? 1 : 0
triggers = {
snapshot_bridge = local.snapshot_bridge
}
connection {
user = var.ssh_host_user
private_key = file(var.ssh_host_private_key_file)
host = var.ssh_host_ip
port = var.ssh_host_port
}
provisioner "remote-exec" {
inline = [ local.snapshot_bridge ]
}
depends_on = [ null_resource.init_bridge, ]
}
#data "remote_file" "bridge_adress_info" {
# #count = var.node_type == "bridge" ? 1 : 0
#
# conn {
# user = var.ssh_host_user
# private_key = file(var.ssh_host_private_key_file)
# host = var.ssh_host_ip
# port = var.ssh_host_port
# agent = file(var.ssh_host_private_key_file) == null
# sudo = true
# }
# path = "~/bridge_adress_info"
#
# depends_on = [ null_resource.init_bridge ]
#}
#
#output "bridge_adress_info" {
# value = data.remote_file.bridge_adress_info.content
#}