0

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

joyy created at4 years ago view count: 1454

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
4 years ago 回复

相关搜索关键词

Recent search keywords