问题
I have a comma_delimited_list which represents list of fixed IPs and in my OS::Heat::ResourceGroup
I want that each node will get one fixed ip based on his current index.
I have the following heat template (I've pasted only the relevant):
my_fixed_ips:
type: comma_delimited_list
resources:
MyResource:
type: OS::Heat::ResourceGroup
properties:
count: { get_param: my_node_count }
resource_def:
type: MyTemplate.yaml
properties:
fixed_ip: { get_param: [ my_fixed_ips, %index% ] }
name: myName%index%
when i run the command:
openstack stack create TomerProtected -e Environment.env -t Template.yaml -f yaml
I'm getting the error: found character '%' that cannot start any token
I've tried to set index_var to something else (index and not %index%) but still i can not get any specific value from the comma_delimited_list.
my question is - how to iterate comma_delimited_list using %index% from OS::Heat::ResourceGroup
?
any ideas?
UPDATE:
I've found a solution by myself but it doesn't pleases me:
Ive changed index_var to: index Passed the comma_delimited_list and the current index from this template to MyTemplate.yaml. From MyTemplate.yaml I could get specific value from the comma_delimited_list:
fixed_ips: [ { "ip_address": { get_param: [ my_fixed_ips, get_param: index ] } } ]
but there most be a way to do this from OS::Heat::ResourceGroup
来源:https://stackoverflow.com/questions/37372669/openstack-how-to-iterate-comma-delimited-list-using-index-from-osheatres