我試圖在爲目的地區段預製with_items
時進行多重連接。Concat多個變量和字符串在可靠的劇本
現在它看起來是這樣的:
- 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 }}"
試過幾個方法,但沒有得到的東西的工作。
是否有可能與字符串連接變量?
結束了使用這個艱難的兩個都是正確的。謝謝 :) – Moshe