How do you perform a package install as 'root' via sudo in Chef?
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.
精彩评论