6
是否可以在Ansible playbook中將項目列表應用於多個任務?舉個例子:在多個任務上應用with_items
- name: download and execute
hosts: server1
tasks:
- get_url: url="some-url/{{item}}" dest="/tmp/{{item}}"
with_items:
- "file1.sh"
- "file2.sh"
- shell: /tmp/{{item}} >> somelog.txt
with_items:
- "file1.sh"
- "file2.sh"
是否有一些語法來避免重複項目列表?