Today you can use with_items with include , so you need to split your game into two files:
- name: download and execute hosts: server1 tasks: - include: subtasks.yml file={{item}} with_items: - "file1.sh" - "file2.sh"
and subtasks.yml :
- get_url: url="some-url/{{file}}" dest="/tmp/{{file}}" - shell: /tmp/{{file}} >> somelog.txt
There is a request to make with_items applicable to block , but it is still not implemented.
source share