如何以“root”身份执行软件包安装通过厨师中的 sudo 吗?
使用 Chef,是否可以在安装包的配方中添加一些内容,以使包命令作为超级用户运行,而不是作为超级用户运行 Chef 命令,例如,
package "mysql" do
user: sudo
action :install
end
因此这将执行 sudo apt-get install mysql 而不是比 apt-get install mysql 。在文档中找不到任何内容。
With chef, is it possible to add something to a recipe that is installing a package to make the package command run as the super user rather than run the chef command as the super user, e.g.
package "mysql" do
user: sudo
action :install
end
So this would execute sudo apt-get install mysql rather than apt-get install mysql. Can't find anything in the docs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,如果您需要 root 访问权限来配置系统,则可以在 sudo 下运行整个厨师客户端进程,而不是作为普通用户运行。
然而,社区成员创建了一个 "chef-sudo" rubygem 来协助解决此问题。
Generally if you need root access to configure the system, you run the entire chef-client process under sudo, rather than as a normal user.
However, a member of the community created a "chef-sudo" rubygem to assist with this.