Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Heat Template: Using get_param within get_file

Hi
Have a simple template that defines config_file as a parameter and would like to pass it as an argument to get_file:

heat_template_version: 2013-05-23
description: Template that installs a mesos nodes.
parameters:
...
config_file:
    type: string
    label: Config File
    description: Path to config file
    default: config.sh
resources:
  instance:
    type: OS::Nova::Server
    properties:
...
      user_data_format: RAW
      user_data:
          template: { get_file: { get_param: config_file } }
...

This fails with the following message:

Create Failed
Resource Create Failed: Stackvalidationfailed: Property Error : Instance: User Data No Content Found In The "Files" Section For Get File Path: Config.Sh

Tried the following as well:

...
           str_replace:
          params:
           ConfigFile: { get_param: config_file }
          template: |
           { get_file: ConfigFile }
...

(Note that "|" is needed, otherwise I get the following error message:

 Could not fetch contents for file:///xxx/ConfigFile

)
The above gets further and instantiates a node; however, script is not executed during cloud-init:

...
ci-info: |   0   |   0.0.0.0   | 10.40.50.1 |    0.0.0.0    |    eth0   |   UG  |
ci-info: |   1   |  10.40.50.0 |  0.0.0.0   | 255.255.255.0 |    eth0   |   U   |
ci-info: +-------+-------------+------------+---------------+-----------+-------+
2015-07-08 14:56:37,317 - __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: '{ get_file: config...'
Generating public/private rsa key pair.
...

Any thoughts?
(should mention that all is fine if I directly insert the file name in get_file.)
Cheers,

Heat Template: Using get_param within get_file

Hi
Have a simple template that defines config_file as a parameter and would like to pass it as an argument to get_file:

heat_template_version: 2013-05-23
description: Template that installs a mesos nodes.
parameters:
...
config_file:
    type: string
    label: Config File
    description: Path to config file
    default: config.sh
resources:
  instance:
    type: OS::Nova::Server
    properties:
...
      user_data_format: RAW
      user_data:
          str_replace:
          params:
          ....
          template: { get_file: { get_param: config_file } }
...

This fails with the following message:

Create Failed
Resource Create Failed: Stackvalidationfailed: Property Error : Instance: User Data No Content Found In The "Files" Section For Get File Path: Config.Sh

Tried the following as well:

...
           str_replace:
          params:
           ConfigFile: { get_param: config_file }
          template: |
           { get_file: ConfigFile }
...

(Note that "|" is needed, otherwise I get the following error message:

 Could not fetch contents for file:///xxx/ConfigFile

)
The above gets further and instantiates a node; however, script is not executed during cloud-init:

...
ci-info: |   0   |   0.0.0.0   | 10.40.50.1 |    0.0.0.0    |    eth0   |   UG  |
ci-info: |   1   |  10.40.50.0 |  0.0.0.0   | 255.255.255.0 |    eth0   |   U   |
ci-info: +-------+-------------+------------+---------------+-----------+-------+
2015-07-08 14:56:37,317 - __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: '{ get_file: config...'
Generating public/private rsa key pair.
...

Any thoughts?
(should mention that all is fine if I directly insert the file name in get_file.)
Cheers,