将多个符合正则的文件拷贝到目标机器
- name: Copy
copy: src={{ item }} dest=/root/.sshkeys mode=0600
owner=root group=root
with_fileglob:
- keys/*.pub
将多个文件合并
- name: Assemble keys into authorized_keys file
assemble: src=/root/.sshkeys dest=/root/.ssh/authorized_keys
mode=0600 owner=root group=root
register
把任务的输出定义为变量,然后用于其他任务