str_replace with get_attr in Openstack Icehouse [closed]
Hi everyone,
I have the following HOT template
heat_template_version: 2013-05-23
description: Simple HOT template with dependencies
resources:
instance1:
type: OS::Nova::Server
depends_on: instance2
properties:
key_name: default
image: 80a652ae-5b08-48c8-b069-b4c02c1b24fe
flavor: singles.1
user_data_format: RAW
user_data:
str_replace:
template: |
#!/bin/bash
echo "$FOO" > /tmp/message
exit 0
params:
$FOO: { get_attr: [ instance2, networks, private-net ] }
instance2:
type: OS::Nova::Server
properties:
key_name: default
image: 80a652ae-5b08-48c8-b069-b4c02c1b24fe
flavor: singles.1
outputs:
instance_ip1:
value: { get_attr: [instance1, networks, private-net] }
When I am trying to launch the stack, I get the following error:
Resource CREATE failed: StackValidationFailed: Property
error : instance1: user_data "str_replace" params must
be strings or numbers
and from http://docs.openstack.org/developer/heat/template_guide/hot_spec.html#str-replace (here) I can conclude that in version 2013-05-23 str_replace does not support replacing between stringes and JSON objects. Is this correct? If this is the case, how can I dynamically inject the IP address of instance2 into the script executed at instance1?
I attach the heat version I am running:
ii heat-api 2014.1.5-0ubuntu1 all OpenStack orchestration service - ReST API
ii heat-api-cfn 2014.1.5-0ubuntu1 all OpenStack orchestration service - CFN API
ii heat-common 2014.1.5-0ubuntu1 all OpenStack orchestration service - common files
ii heat-engine 2014.1.5-0ubuntu1 all OpenStack orchestration service - engine
ii python-heat 2014.1.5-0ubuntu1 all OpenStack orchestration service - Python files
ii python-heatclient 0.2.8-0ubuntu1 all client library and CLI for OpenStack Heat
Thank you in advance.