-
Notifications
You must be signed in to change notification settings - Fork 1
/
09_install_helm.tf
35 lines (29 loc) · 941 Bytes
/
09_install_helm.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
data "template_file" "helm_install_script" {
count = length(var.server_topology)
template = file("templates/scripts/install_helm.sh")
vars = {
helm_version = var.helm_version
}
}
resource "null_resource" "install_helm"{
depends_on = [
null_resource.install_k3s
]
count = length(var.server_topology)
connection {
type = "ssh"
user = "root"
private_key = file(var.ssh_key_path)
host = element(packet_device.k3s_master_nodes.*.access_public_ipv4, count.index)
}
provisioner "remote-exec" {
inline = ["mkdir -p /root/bootstrap/scripts/"]
}
provisioner "file" {
content = element(data.template_file.helm_install_script.*.rendered, count.index)
destination = "/root/bootstrap/scripts/install_helm.sh"
}
provisioner "remote-exec" {
inline = ["bash /root/bootstrap/scripts/install_helm.sh"]
}
}