0

ansible 怎样用fetch模块拷贝整个目录

joyy created at6 years ago view count: 1559

ansible -i hosts all -m fetch -a "src=/root/test/dest=/tmp/"

报错如下 "remote file is a directory, fetch cannot work on directories

report
回复
-1

用playbook

- shell: (cd /remote; find . -maxdepth 1 -type f) | cut -d'/' -f2
  register: files_to_copy

- fetch: src=/remote/{{ item }} dest=/local/
  with_items: files_to_copy.stdout_lines
6 years ago 回复

Recent search keywords