ansible copy 模块 复制文件夹

ansible copy模块复制文件或文件夹,默认是从控制机器指定目录,复制到远程机器指定目录,复制文件夹的时候需要注意点如下: Local path to a file to copy to the remote server. This can be...
ansible copy模块复制文件或文件夹,默认是从控制机器指定目录,复制到远程机器指定目录,复制文件夹的时候需要注意点如下:
Local path to a file to copy to the remote server.
This can be absolute or relative.
If path is a directory, it is copied recursively. In this case, if path ends with "/", 
only inside contents of that directory are copied to destination. Otherwise, if it 
does not end with "/", the directory itself with all contents is copied. This behavior 
is similar to the rsync command line tool.
【如果路径是一个文件夹,它会递归copy,这种情况下,如果路径以"/" 结尾,仅有文件夹下的文件(ps:如果文件夹下还是文件夹,就copy这些文件夹,忽略的上层目录)的内容被copy到目的地址,如果不以"/" 结尾,整个文件夹被copy到远程机器】


从ansible 2.8 开始, remote_src 已经开始支持了递归copy, remote_src 意为,把远程机器上的文件【文件夹】copy 到此远程机器上的另外一个地方。

  • 发表于 2022-02-14 16:37
  • 阅读 ( 34 )

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
shitian
shitian

662 篇文章

作家榜 »

  1. shitian 662 文章
  2. 石天 437 文章
  3. 每天惠23 33 文章
  4. 小A 29 文章