I have a configuration which uses Kubespray - essentially a set of Ansible playbooks used to manage the life cycle of Kubernetes clusters. Some of the configuration for this comes in the form of YAML files, for example k8s-cluster.yml, which contains things such as the container runtime and the version of Kubernetes to be deployed. I’ve taken this and turned into a template so that I can generate a file for the actual deployment of the cluster using value that originate from HCL variables. This works, however, if the YAML file changes in the GitHub repo for Kubespray, I then have to obtain this and recreate the template, which is not a great way of working. I could do something such as embed calls to awk, sed or Perl inside a provisioner, but, embedding one language within another (HCL) is not great either. The specific problem I want to solve in an elegant way is how to use templates when the source of the template is in GitHub and is likely to change.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Loops in templates with yamlencode | 16 | 7086 | September 18, 2020 | |
Wrong indentation in yaml file inserted into terraform template | 0 | 658 | November 3, 2021 | |
How to generate terraform HCL code | 17 | 8861 | September 30, 2022 | |
Using Helm_Release with dynamic config | 1 | 963 | January 4, 2021 | |
Multi-level maps with a list over template in Terraform | 0 | 995 | July 6, 2022 |