试图用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 %}
想象一下,这就是我最终做的! (作为一个数组传递脚本,每行一个项目) –