-
Notifications
You must be signed in to change notification settings - Fork 583
Orchestration: composable templates with realtive paths not working #2735
Description
Orchestration with stacks.Create() does not support including a templates with a path relative to the template it is included in, unless it's in the same directory. Additionally, the paths of included templates or files within a child template are not updated which makes the stack creation on OpenStack fail. This makes template composition almost impossible.
Example: Consider we have a top-level template as follows:
resources:
my_stack:
type: substacks/my_substack.yaml
and the sub-stack is defined in substacks/my_substack.yaml as:
resources:
my_server:
type: ../templates/my_nova.yaml
my_backend:
type: "OS::Nova::Server"
properties:
...
This sub-stack itself references another template in a different directory, to which it refers using a relative path ../templates/my_nova.yaml.
This currently doesn't work because the my_nova template will be fetched from <base_url>/substacks/templates/my_nova.yaml, resulting in a 404 error, when it should be fetched from <base_url>/templates/my_nova.yaml.
Also, the path for the my_server child template is not updated in the sub-stack content when included in the request towards the OpenStack API which causes a failure to find the my_nova.yaml and prevents deployment of the stack.
The same templates can be deployed just fine using the OpenStack CLI which shows that the URL mapping done by gophercloud is not correct.
This is possibly related to issue #2219, although not quite the same (but I'm not sure I understood that other issue).