2017-07-17 07:45:34 +02:00
|
|
|
# Secure copy kubeconfig to all nodes to activate kubelet.service
|
2017-10-15 05:41:18 +02:00
|
|
|
resource "null_resource" "copy-kubeconfig" {
|
2017-07-17 07:45:34 +02:00
|
|
|
count = "${length(var.worker_names)}"
|
|
|
|
|
|
|
|
connection {
|
|
|
|
type = "ssh"
|
|
|
|
host = "${element(var.worker_domains, count.index)}"
|
|
|
|
user = "core"
|
|
|
|
timeout = "60m"
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "file" {
|
|
|
|
content = "${var.kubeconfig}"
|
|
|
|
destination = "$HOME/kubeconfig"
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "remote-exec" {
|
|
|
|
inline = [
|
|
|
|
"sudo mv /home/core/kubeconfig /etc/kubernetes/kubeconfig",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|