sudo: puppet: command not found – when trying to use puppet with rvm in aws

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

When trying to use the

command in a aws instance to follow the instruction from ‘Deploying Rails’, the following error complains that the puppet command is not found, like:

After some searching and having a look at the blog post here and using the rvm notes in the aws instance and looking at this:

It seems that for security reason the sudo command resets the path in the system.

You can actually see that this the case by running the command to display the path of the normal user:

and the corresponding one for the sudo:

So a workaround to make it work is to add your group into the exemptions group in the visudo file, which means editing the visudo file:

and adding the group that your user you are working with belongs to:

  • Another workaround is to sudo visudo then append the /opt/puppetlabs/bin to the secure_path statement there.

  • kosmasc

    Thank you!