tosca template cloud-config

asked 2020-06-02 06:56:15 -0500

AB239 gravatar image

Hey there,

I am in process of converting an existing HEAT template into a TOSCA equivalent that is to be used with TACKER. After reading a lot of pages on google, I am yet to find an example where cloud-config is effectively supported in a TOSCA template. Please read through...

Sample HEAT template that works!

heat_template_version: 2016-04-08
parameters:
  key:
    type: string
  image:
    type: string
...
resources:
...
  config1:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        merge_how: dict(recurse_array)+list(append)
        chpasswd:
          list: |
            <user-name>: <pass>
          expire: False 
        write_files:
        - path: /tmp/test.sh
          content: {get_file: files/test.sh}
 config2:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        merge_how: dict(recurse_array)+list(append)
        write_files:
        - path: /tmp/cleanup.sh
          content: {get_file: files/cleanup.sh}
     runcmd: 
 ...
  vm_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: config1}
      - config: {get_resource: config2}
  testvm:
    type: OS::Nova::Server
    properties:
      name: testvm
      image: { get_param: image}
      key_name: { get_param: key }
      user_data_format: SOFTWARE_CONFIG
      user_data: {get_resource: vm_init}

I need to convert it to TOSCA equivalent. Till now, I can only see user_data section for TOSCA that suggests adding all cloud-config commands inline in the template but with a lot of VDUs, this approach is error prone.

Any suggestions or pointers related to this?

edit retag flag offensive close merge delete