試圖用YAML和神社使用谷歌部署管理器與一個多變量,如:谷歌部署管理:MANIFEST_EXPANSION_USER_ERROR多變量
startup_script_passed_as_variable: |
line 1
line 2
line 3
及更高版本:
{% if 'startup_script_passed_as_variable' in properties %}
- key: startup-script
value: {{properties['startup_script_passed_as_variable'] }}
{% endif %}
給出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 ""
試過(並失敗):
{% if 'startup_script' in properties %}
- key: startup-script
value: {{ startup_script_passed_as_variable }}
{% endif %}
也
{% if 'startup_script' in properties %}
- key: startup-script
value: |
{{ startup_script_passed_as_variable }}
{% endif %}
和
{% if 'startup_script' in properties %}
- key: startup-script
value: |
{{ startup_script_passed_as_variable|indent(12) }}
{% endif %}
想象一下,這就是我最終做的! (作爲一個數組傳遞腳本,每行一個項目) –