[k8s] Make bootkube start depend on bootkube render

This commit is contained in:
Nemo 2019-01-13 01:40:20 +05:30
parent 789c9c5d3f
commit 97ef9179e4
3 changed files with 24 additions and 4 deletions

View File

@ -25,10 +25,11 @@ module "bootkube-render" {
}
module "bootkube-start" {
source = "modules/bootkube"
mode = "start"
host_ip = "${var.ips["dovpn"]}"
k8s_host = "k8s.${var.root-domain}"
depends_on = "${module.bootkube-render.image}"
source = "modules/bootkube"
mode = "start"
host_ip = "${var.ips["dovpn"]}"
k8s_host = "k8s.${var.root-domain}"
providers = {
docker = "docker.sydney"

View File

@ -0,0 +1,13 @@
# output "exit_code" {
# # TODO: Pick correct exit code
# # value = "${coalesce(formatlist("%s", docker_container.render.*.exit_code))}"
# # See https://github.com/hashicorp/terraform/issues/15165
# value = "${var.mode == "render" ?
# "${element(concat(docker_container.render.*.exit_code, list("")), 0)}" :
# "${element(concat(docker_container.start.*.exit_code, list("")), 0)}"
# }"
# }
output "image" {
value = "${docker_image.image.latest}"
}

View File

@ -27,3 +27,9 @@ variable "mode" {}
variable "version" {
default = "0.14.0"
}
variable "depends_on" {
default = []
type = "list"
}