[Heat] cloud-init and colon+space
Hi colleagues,
I'm using the following way to pass cloud-init info into VM:
n2: type: OS::Nova::Server properties: [ ... ] user_data_format: SOFTWARE_CONFIG user_data: str_replace: template: { get_file: CI-v17.yaml } params: NTFY: { get_attr: ['wait_handle', 'curl_cli'] }
where CI-v17.yaml is the following:
#cloud-config [ ... ] timezone: Europe/Kiev runcmd: - NTFY --data-binary '{"status": "SUCCESS"}' [ ... ]
Unfortunatelty, NTFY expands to something that contains YAML control sequence ": " (colon+space e.g. X-Auth-Token: 'something') which leads to parsing error.
Is there any way to escape this sequence with something that will prevent YAML parsing error? Note that I want to use external file to store cloud-init config since I use it for multiple VMs.
Try to use
n2-ci: type: OS::Heat::CloudConfig properties: cloud_config: str_replace: template: { get_file: CI-v17.yaml } params: NTFY: { get_attr: ['wait_handle', 'curl_cli'] } n2: type: OS::Nova::Server properties: [ ... ] user_data_format: SOFTWARE_CONFIG user_data: { get_resource: n2-ci }
leads to the following Heat error:
ERROR: Property error: : resources.n2-ci.properties.cloud_config: : "#cloud-config [ ... ]" is not a map
I will appreciate any ideas on how to work around this issue.
Thank you.