使用Chef在Windows节点上挂载Windows共享 [英] Mount windows shares on a windows node with Chef

查看:60
本文介绍了使用Chef在Windows节点上挂载Windows共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Windows共享中的文件复制到节点的缓存中。显然,无法从remote_file进行此操作,因此我的另一种想法是尝试将Windows共享安装到本地驱动器,并通过文件资源访问所需的文件。但是,即使Chef告诉我安装成功,也无法在节点上看到共享并访问它。

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

就像 https:// tickets .opscode.com / browse / CHEF-1267 建议。

但是这不起作用:

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

基于此输出,共享已安装,但是在Windows节点上不可用。

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

推荐答案

这很正常。 Windows驱动器映射不在会话之间共享,因此在运行Chef的会话中映射的驱动器在任何其他会话中都不可见。此外,默认情况下映射不是永久性的,因此在一个Chef会话中创建的映射在以后的会话中将不可用(默认情况下)。

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.

这篇关于使用Chef在Windows节点上挂载Windows共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆