forked from tibordp/terraform-hcloud-dualstack-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddons.tf
43 lines (37 loc) · 1.08 KB
/
addons.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
resource "null_resource" "install_addons" {
depends_on = [
null_resource.cluster_bootstrap
]
triggers = {
wigglenet_manifest = templatefile("${path.module}/templates/wigglenet.yaml.tpl", {
filter_pod_ingress_ipv6 = var.filter_pod_ingress_ipv6
})
ccm_manifest = templatefile("${path.module}/templates/hetzner_ccm.yaml.tpl", {})
hcloud_token = var.hcloud_token
}
connection {
host = local.kubeadm_host
type = "ssh"
timeout = "5m"
user = "root"
private_key = file(var.ssh_private_key_path)
}
provisioner "file" {
content = self.triggers.wigglenet_manifest
destination = "/root/wigglenet.yaml"
}
provisioner "file" {
content = self.triggers.ccm_manifest
destination = "/root/hetzner_ccm.yaml"
}
provisioner "file" {
source = "${path.module}/scripts/install-addons.sh"
destination = "/root/install-addons.sh"
}
provisioner "remote-exec" {
inline = [
"chmod +x /root/install-addons.sh",
"HCLOUD_TOKEN='${var.hcloud_token}' /root/install-addons.sh",
]
}
}