OS::Heat::ResourceGroup does not substitute index_var within intrinsics.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Triaged
|
Medium
|
Joe D'Andrea |
Bug Description
Presently, %index% can only be used in basic string substitutions, e.g., name: my_server_%index%, not within intrinsics. This happens because intrinsics are evaluated before the %index% replacement takes place, thus using it within any intrinsic will not result in a substitution.
It would be useful to support the use of %index% within intrinsics, prior to evaluation. This would afford a natural way to pass parameters to each member of a resource group.
Use Case: Create a set of VMs of the same type where IP address assignments are fixed in advance and must be passed in as parameters. The template may look something like this:
parameters:
server_names:
type: comma_delimited
resources:
server_group:
type: OS::Heat:
properties:
count: 3
type: OS::Nova::Server
name: { get_param: [ server_names, %index% ] }
This has been explored in the past (randallburt, Drago1) but it was rather tricky to do, if at all. Filing it here so that we can track it in case it can ever be resolved (and to see if others are interested in taking this one on).
As an interim workaround, kfox1111 suggests utilizing a nested stack as the resource, passing the index as a parameter.
Changed in heat: | |
assignee: | nobody → Joe D'Andrea (joedandrea) |
summary: |
- OS::Heat::ResourceGroup does not substitute index_var within intrinsics. + OS::Heat::ResourceGroup does not substitute %index% within intrinsics. |
summary: |
- OS::Heat::ResourceGroup does not substitute %index% within intrinsics. + OS::Heat::ResourceGroup does not substitute index_var within intrinsics. |
Changed in heat: | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: dtag |
Changed in heat: | |
milestone: | none → no-priority-tag-bugs |
> As an interim workaround, kfox1111 suggests utilizing a nested stack as the resource, passing the index as a parameter.
Yes, we use this same approach in tripleo- heat-templates and it works fine as a workaround, enabling this cleaner syntax would certainly be worth further exploring though.