A file with a copy of the chef (via remote_file?) From the Windows shared folder

I had to copy some files to a Windows host from a Windows shared folder the other day. To my horror, I realized that there is no built-in option for this:

  • remote_file does not accept a Windows network share as a source
  • windows_package (from the Windows cookbook) is intended only to run installers (.msi / .exe, etc.), ...?

Is the only solution to write a special helper library that copies a file? This sounds like the basic functionality that must exist in the remote_file. Am I missing something or does the chef have no built-in option for a simple copy of files from Windows shares?

+4
source share
2

Windows remote_file, URL ( ):

remote_file "foo" do
  source "file:////server/path/to/file"
  path "/path/to/local/file"
end

, CIFS.

+7

3 . :

directory 'c:/mydirectory' do
  recursive true
end

mount "P:" do
  device '\\\\myserver\\myshare'
  username "myusername"
  password "mypassword"
end

remote_file "c:/mydirectory/myfile.txt" do
  source 'file:///P:/path_behind_myshare/myfile.txt'
end

mount "P:" do
  device '\\\\myserver\\myshare'
  action :umount
end
0

Source: https://habr.com/ru/post/1542270/


All Articles