Last active
January 8, 2020 17:56
-
-
Save iolloyd/b462f3812407fdfa5bb2857a7fbc3710 to your computer and use it in GitHub Desktop.
dynamic inventory from terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[kube-master] | |
${k8s_master_name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "template_file" "demo" { | |
template = "${file("./templates/demo.tpl")}" | |
vars { | |
some_var_list = "${join("\n", some_machine.k8s-master.*.name)}" | |
} | |
} | |
resource "local_file" "demo" { | |
content = "${data.template_file.demo.rendered}" | |
filename = "./inventory/host" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[kube-master] | |
k8s-master-01 | |
k8s-master-02 | |
k8s-master-03 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment