0

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

joyy 发布于1年前 阅读数 77

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

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

举报
回复
0

用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
1年前 回复

相关搜索关键词