Google Deployment manager: MANIFEST_EXPANSION_USER_ERROR multiline variables

Viewed 3878

Trying to use Google Deployment Manager with YAML and Jinja with a multi-line variables, such as:

startup_script_passed_as_variable: |
  line 1
  line 2
  line 3

And later:

{% if 'startup_script_passed_as_variable' in properties %}
    - key: startup-script
      value: {{properties['startup_script_passed_as_variable'] }}
{% endif %}

Gives MANIFEST_EXPANSION_USER_ERROR:

ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation operation-1432566282260-52e8eed22aa20-e6892512-baf7134:

MANIFEST_EXPANSION_USER_ERROR
Manifest expansion encountered the following errors: while scanning a simple key in "" could not found expected ':' in ""

Tried (and failed):

{% if 'startup_script' in properties %}
        - key: startup-script
          value: {{ startup_script_passed_as_variable }}
{% endif %}

also

{% if 'startup_script' in properties %}
        - key: startup-script
          value: | 
            {{ startup_script_passed_as_variable }}
{% endif %}

and

{% if 'startup_script' in properties %}
        - key: startup-script
          value: | 
            {{ startup_script_passed_as_variable|indent(12) }}
{% endif %}
2 Answers
Related