# Heat global environment yaml

Hi everyone,

I have created a complex series of nested heat templates for use in my company and the goal is to make these portable between openstack deployments. The user_data passed in the various resources often have lab specific data which means that every environment needs to modify the template with their IPs (think NTP, DNS etc). With that in mind, I am trying to leverage the /etc/heat/environment.d/ global environment to allow each separate deployment to have a "config.yaml" where they can put the IPs / FQDNs that apply to their environment. The goal is that I would not need to modify any of the existing templates to support a new environment, only the config.yaml that would be placed into /etc/heat/environment.d/.

The problem I am having here is that no matter what I put into this directory I cannot get it to work as described in the documentation. In the docs, there is an example given where they use the stack-create command with -e <something>.yaml. Further in the docs when it is describing the global environments it states that the same yaml provided in the earlier command could also be put into this directory and would no longer need to be passed in.

In my case, I am doing a simple example:

main.yaml

parameters:
test:
type: string
label: test

...


config.yaml

parameters:
test: value


When I run the stack create with -e passing in config.yaml it works as expected. When I put config.yaml into that directory, restart heat, and try it again without -e it complains that I have not provided all of the parameters.

Is there something I am missing to make this work? I can see in the logs that it has loaded my config.yaml and there are no errors.

edit retag close merge delete

Sort by » oldest newest most voted

The 'global environment' doesn't do what you think it does. It's a place where the operator can put templates and environment files that map resource type names to either other types or to templates in that directory. It's not something that end-users can access.

You'll need to distribute the environment files with your templates, or put them somewhere accessible (e.g. in Swift). Users will need to specifically select an environment file when they create or update a stack.

more