-
Notifications
You must be signed in to change notification settings - Fork 12
/
addons.tf
53 lines (46 loc) · 1.47 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
44
45
46
47
48
49
50
51
52
53
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
native_routing_ipv4 = var.use_hcloud_network
})
ccm_manifest = templatefile("${path.module}/templates/hetzner_ccm.yaml.tpl", {
use_hcloud_network = var.use_hcloud_network
pod_cidr_ipv4 = var.pod_cidr_ipv4
})
csi_manifest = templatefile("${path.module}/templates/hetzner_csi.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" {
content = self.triggers.csi_manifest
destination = "/root/hetzner_csi.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}' HCLOUD_NETWORK='${var.hcloud_network_id}' /root/install-addons.sh",
]
}
}