Chef Mount必须是root才能使用选项

时间:2017-01-31 22:28:31

标签: chef chef-recipe chef-solo

我有以下mount命令作为我的食谱的一部分。我需要这个以root身份运行,因为我收到一条错误消息,只有root才能使用选项。感谢您的帮助。

mount mounted_dir do
  action :mount
  fstype 'cifs'
  device '//192.168.0.100/Users/rcondron/Desktop/smart-mobile-images'
  enabled node['smart-mobile']['share']['mount_share']
  options "username=testuser,password=testpwd,domain=domain,file_mode=0777,dir_mode=0777,uid=0"
end

1 个答案:

答案 0 :(得分:2)

您需要以root身份运行Chef本身。

{ "status": "ok", "sig": "707079741", "table": { "cols": [ { "type": "date", "id": "date", "label": "Date", "pattern": "" }, { "type": "number", "id": "query0", "label": "chelsea", "pattern": "" } ], "rows": [ { "c": [ { "f": "Jan 31, 2017, 02:08 PST", "v": "2017-01-31" }, { "f": "13", "v": 13.0 } ] }, { "c": [ { "f": "Jan 31, 2017, 02:16 PST", "v": "2017-01-31" }, { "f": "13", "v": 13.0 } ] }, { "c": [ { "f": "Jan 31, 2017, 02:24 PST", "v": "2017-01-31" }, { "f": "13", "v": 13.0 } ] }, ... 命令以任何用户mountchef-client正在运行的方式运行,如果您收到错误消息,表明它不是root,那么我会怀疑出现问题你是如何运营厨师的。