2017-07-29 20:35:53 +02:00
|
|
|
# Secure copy bootkube assets to ONE controller and start bootkube to perform
|
|
|
|
# one-time self-hosted cluster bootstrapping.
|
|
|
|
resource "null_resource" "bootkube-start" {
|
2017-07-30 00:05:21 +02:00
|
|
|
depends_on = ["module.bootkube", "digitalocean_droplet.controllers"]
|
2017-07-29 20:35:53 +02:00
|
|
|
|
|
|
|
connection {
|
|
|
|
type = "ssh"
|
|
|
|
host = "${digitalocean_droplet.controllers.0.ipv4_address}"
|
|
|
|
user = "core"
|
|
|
|
timeout = "15m"
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "file" {
|
|
|
|
source = "${var.asset_dir}"
|
|
|
|
destination = "$HOME/assets"
|
|
|
|
}
|
|
|
|
|
|
|
|
provisioner "remote-exec" {
|
|
|
|
inline = [
|
|
|
|
"sudo mv /home/core/assets /opt/bootkube",
|
|
|
|
"sudo systemctl start bootkube",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|