开发者

How do you perform a package install as 'root' via sudo in Chef?

开发者 https://www.devze.com 2023-03-11 07:31 出处:网络
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,

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号