How do you install a package as root through sudo in Chef?

With the chef, you can add something to the recipe that installs the package so that the package command runs as a superuser rather than executing the chef command as a superuser, for example.

package "mysql" do
  user: sudo
  action :install
end

So this will do sudo apt-get install mysql, not apt-get install mysql. No documents found.

+3
source share
1 answer

Usually, if you need root access to configure the system, you start the entire chef-client process in sudo, and not as a regular user.

However, a community member created a "chef-sudo" rubygem to help with this.

+2
source

All Articles