Skip to content

Orchestration: composable templates with realtive paths not working #2735

@dverbeir

Description

@dverbeir

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions