【发布时间】:2021-06-09 07:19:53
【问题描述】:
ansible 版本:2.10.9
角色:
-name: set fact
set_fact:
fruits: '["banana","apple"]'
模板:
{%- for fruit in fruits -%}
{{ fruit }},
{%- endfor -%}
预期输出:
banana,apple,
但我实际上得到了什么:
[,",b,a,n,a,n,a,",,,",a,p,p,l,e,"],
谁能解释一下为什么所有的字符都用逗号隔开?
【问题讨论】: