【发布时间】:2018-01-06 03:19:08
【问题描述】:
在为目标部分执行 with_items 时,我正在尝试多重连接。
现在看起来像这样:
- name: create app except+lookup
copy: content="" dest="{{ dir.comp ~ '/config/con2dd/' ~ item.name ~ 'File.txt' }}" force=no group=devops owner=devops mode: 0755
with_items:
...
我明白了:
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
尝试了几种方法,但都没有奏效。
是否可以将变量与字符串连接起来?
【问题讨论】:
标签: ansible concatenation yaml