[chef] Re: switch between root and non-root user within a chef script


Chronological Thread 
  • From: JD Harrington < >
  • To:
  • Subject: [chef] Re: switch between root and non-root user within a chef script
  • Date: Thu, 25 Jul 2013 17:32:57 -0400

You can either enable passwordless sudo by modifying /etc/sudoers (at least for the life of the chef run) or sudo once before running chef, which will allow you to continue to sudo without a password for the length of your sudo timeout, which I believe is 5 minutes by default.

On Thu, Jul 25, 2013 at 5:19 PM, Andrew Sharp < " target="_blank"> > wrote:
Hi,

I'm writing a cookbook to set up a development environment on OS X. This cookbook installs packages via Homebrew as well as .dmg packages. I am using the homebrew cookbook
for the homebrew packages, and the dmg cookbook for the .dmg packages.

I would like the script to run without any user input. Since the .dmg packages require root permissions, they stop the script for the user to enter their password. This could be alleviated by running the script with sudo. However, Homebrew requires that it be run as non-root, so I cannot run the script with sudo.

Any suggestions?

Thanks,


Andrew




Archive powered by MHonArc 2.6.16.

§