来自Windows共享的Chef复制文件(通过remote_file?)

kef*_*tes 4 chef-infra

前几天我不得不将一些文件复制到Windows主机上.令我恐惧的是,我意识到没有内置选项:

  • remote_file不接受Windows网络共享作为源
  • windows_package(来自windows cookbook)仅适用于运行安装程序(.msi/.exe等)......?

这是写这个文件副本的自定义助手库的唯一解决方案吗?这听起来像remote_file中应该存在的核心功能.我在这里遗漏了什么,或者厨师确实没有内置选项来从Windows共享的简单文件副本?

Hol*_*ust 7

要使用Windows网络共享中的文件remote_file,您只需使用正确的URL语法(这确实有点不明显):

remote_file "foo" do
  source "file:////server/path/to/file"
  path "/path/to/local/file"
end
Run Code Online (Sandbox Code Playgroud)

这样,即使从CIFS共享复制内容时也能正常工作.