How to iterate comma_delimited_list one by one using %index% from OS::Heat::ResourceGroup?

asked 2016-10-19 16:21:17 -0500

stackboy gravatar image

updated 2016-10-20 14:35:33 -0500

rbowen gravatar image

Hi,

I have defined a comma_delimited_list and I would like to fetch the values one by one on index bases in Resource section "type: OS::Heat::ResourceGroup". But when I am trying with %index% parameter it throwing following Error. Could you please help me accordingly.

Error: Resource CREATE failed: Error: Resource CREATE failed: StackValidationFailed: Property error : 1: Property *name not assigned*

HOT template:

description: Network creation

heat_template_version: '2014-10-16'

parameters: 

  network_count: 
    type: number
    default : 2 
  network_details:
    type: comma_delimited_list
    default: [{"name":"netwrok1","ip":"10.10.0.24","mac":"00:02:03:12:24"},{"name":"netwrok5","ip":"10.10.0.25","mac":"00:02:03:12:25"}]

resources:   
  network_creation:
    type: OS::Heat::ResourceGroup
     properties:
     count: { get_param: network_count }
     resource_def:
        type: template.yaml
        properties:
         network_name: { "Fn::Select" : [ "name" ,{get_param:[network_details, '%index%' ]} ] }
              network_ip: { "Fn::Select" : [ "ip" ,{get_param:[network_details, '%index%' ]} ] }
              mac_addr: { "Fn::Select" : [ "macr" ,{get_param:[network_details, 0 ]} ] }

* if I use "0" instead of %index% variable , I am able to see the 0th record details. ** I have tried get_param index, index, "%index%" :( even though it is throwing same error.

edit retag flag offensive close merge delete