Template etcd_servers list to replace null_resource.repeat

* Remove the last usage of null_resource.repeat, which has
always been an eyesore for creating the etcd server list
* Originally, #224 switched to templating the etcd_servers
list for all clouds, but had to revert on GCP in #237
* https://github.com/poseidon/typhoon/pull/224
* https://github.com/poseidon/typhoon/pull/237
This commit is contained in:
Dalton Hubble
2018-08-21 22:36:42 -07:00
parent bdf1e6986e
commit b8eeafe4f9
5 changed files with 39 additions and 37 deletions

View File

@ -28,7 +28,7 @@ resource "google_compute_instance_template" "worker" {
machine_type = "${var.machine_type}"
metadata {
user-data = "${data.ct_config.worker_ign.rendered}"
user-data = "${data.ct_config.worker-ignition.rendered}"
}
scheduling {
@ -64,8 +64,15 @@ resource "google_compute_instance_template" "worker" {
}
}
# Worker Container Linux Config
data "template_file" "worker_config" {
# Worker Ignition config
data "ct_config" "worker-ignition" {
content = "${data.template_file.worker-config.rendered}"
pretty_print = false
snippets = ["${var.clc_snippets}"]
}
# Worker Container Linux config
data "template_file" "worker-config" {
template = "${file("${path.module}/cl/worker.yaml.tmpl")}"
vars = {
@ -75,9 +82,3 @@ data "template_file" "worker_config" {
cluster_domain_suffix = "${var.cluster_domain_suffix}"
}
}
data "ct_config" "worker_ign" {
content = "${data.template_file.worker_config.rendered}"
pretty_print = false
snippets = ["${var.clc_snippets}"]
}