- hosts: woshi129 tasks: - name: copy /etc copy: src: "{{ item }}" dest: /root/ooo/ with_fileglob: - /data/ppp/* - name: combine command: echo "msg={{ item.0 }} and {{ item.1 }}" with_together: - [1,2,3] - ['a','b']
with_fileglob: Transfer all files under the file as variables, but not recursively.
with_together: transfer variables in the form of a list combination