-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote_exec_web_flask.tf
97 lines (89 loc) · 3.34 KB
/
remote_exec_web_flask.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
resource "null_resource" "configure_cluster_node_flask" {
count = var.install_product == "Flask" && var.deploy_adb == "True" ? var.cluster_size : 0
provisioner "file" {
connection {
type = "ssh"
user = "opc"
private_key = chomp(file(var.ssh_private_key_path))
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
script_path = "/home/opc/.ssh/cos_key.openssh"
agent = false
timeout = "10m"
}
content = data.template_file.sqlnet_ora_template.rendered
destination = "/tmp/sqlnet.ora"
}
provisioner "file" {
connection {
type = "ssh"
user = "opc"
private_key = chomp(file(var.ssh_private_key_path))
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
script_path = "/home/opc/.ssh/cos_key.openssh"
agent = false
timeout = "10m"
}
source = "${path.module}/adb_wallet.zip"
destination = "/tmp/adb_wallet.zip"
}
provisioner "file" {
connection {
type = "ssh"
user = "opc"
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
script_path = "/home/opc/.ssh/cos_key.openssh"
private_key = chomp(file(var.ssh_private_key_path))
agent = false
timeout = "10m"
}
content = data.template_file.flask_ATP_py_template.rendered
destination = "/tmp/flask_ATP.py"
}
provisioner "file" {
connection {
type = "ssh"
user = "opc"
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
script_path = "/home/opc/.ssh/cos_key.openssh"
private_key = chomp(file(var.ssh_private_key_path))
agent = false
timeout = "10m"
}
content = data.template_file.flask_ATP_sh_template.rendered
destination = "/tmp/flask_ATP.sh"
}
provisioner "file" {
connection {
type = "ssh"
user = "opc"
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
private_key = chomp(file(var.ssh_private_key_path))
script_path = "/home/opc/.ssh/cos_key.openssh"
agent = false
timeout = "10m"
}
content = data.template_file.flask_bootstrap_template.rendered
destination = "/tmp/flask_bootstrap.sh"
}
provisioner "remote-exec" {
connection {
type = "ssh"
user = "opc"
bastion_host = oci_core_instance.bastion_instance.public_ip
host = oci_core_instance.web_instance[count.index].create_vnic_details[0].private_ip
private_key = chomp(file(var.ssh_private_key_path))
script_path = "/home/opc/.ssh/cos_key.openssh"
agent = false
timeout = "10m"
}
inline = [
"chmod +x /tmp/flask_bootstrap.sh",
"sudo /tmp/flask_bootstrap.sh"]
}
depends_on = [module.adb]
}