Mount windows shares on a windows node with Chef

只谈情不闲聊 提交于 2020-01-15 04:41:27

问题


I'm trying to copy files from a windows share to my node's cache. Apparently there's no way to do that from remote_file so my alternative thought is to try and mount the windows share to a local drive and access the files I need via the file resource. However even though Chef is telling me the mount succeeded I'm unable to see the share and access it on the node.

mount "H:" do
  device "\\\\ \\software"
  action :mount
end

Just like https://tickets.opscode.com/browse/CHEF-1267 suggests.

However this isn't working:

Recipe: ossec::default←[0m
  * mount[H:] action mount←[0m[2014-06-04T07:37:03-07:00] INFO: Processing mount
[H:] action mount (ossec::default line 20)
[2014-06-04T07:37:03-07:00] INFO: mount[H:] mounted
←[32m
    - mount  to H:←[0m
←[0m
[2014-06-04T07:37:07-07:00] INFO: Chef Run complete in 3.8376 seconds
[2014-06-04T07:37:07-07:00] INFO: Running report handlers
[2014-06-04T07:37:07-07:00] INFO: Report handlers complete
Chef Client finished, 1 resources updated←[0m

Based on this output the share is getting mounted, however it's no available on the windows node.


回答1:


This is normal. Windows drive mappings are not shared across sessions, so drives mapped in the session where Chef is running are not visible in any other sessions. In addition, mappings are not persistent by default so a mapping made in one Chef session will not be available (by default) in later sessions.



来源:https://stackoverflow.com/questions/24040512/mount-windows-shares-on-a-windows-node-with-chef

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!