I’m hoping there is a better way to do this…
I have a series of applications that use their own YAML files. Each YAML file is specific to each application. Then I have several environments that use these same YAML files but with tweaks specific to that environment.
I would like to generate those YAML files from a common template specific for each application. Each YAML files has redundant data. I am trying to have one file for each environment with the variable data in it specific to each environment.
Template YAML file:
variable: << HOST_IP >>
variables file:
HOST_IP="192.168.1.1"
BASH script:
cp app1.yaml.TEMPLATE app1.yaml
sed -i "s/<< HOST_IP >>/$HOST_IP/g" app1.yaml
This works, but I keep thinking there has to be a better way.