1

I.e. I want my template to look something like:

...
resources:
  server1:
    type: OS::Nova::Server
    properties:
      name: Server1
      image: { get_param: image }
      flavor: { get_param: flavor }
      user_data: ?????
...

and I want the contents of user_data to be stored in a separate file.

How can I accomplish this?

ben schwartz
  • 2,559
  • 1
  • 21
  • 20

1 Answers1

2

I believe that's what get_file is for. From the doc:

The example below demonstrates get_file usage with both relative and absolute URLs.

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      # general properties ...
      user_data:
        get_file: my_instance_user_data.sh
  my_other_instance:
    type: OS::Nova::Server
    properties:
      # general properties ...
      user_data:
        get_file: http://example.com/my_other_instance_user_data.sh

If this template was launched from a local file this would result in a files dictionary containing entries with keys file:///path/to/my_instance_user_data.sh and http://example.com/my_other_instance_user_data.sh.

James Polley
  • 7,977
  • 2
  • 29
  • 33