Error in AWS when trying to include puppet modules (Error: Could not find class apache2 for …)

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

Problem

You are trying to work with puppet modules in AWS, after installing puppet as a gem, but when you try to put the modules and manifests outside the main manifests/site.pp file you get an error similar to following:

Solution

Create a file for the puppet configuration in /etc/puppet/puppet.conf and add the paths to your own manifests and modules, like :

and add your paths:

.rvm/bin/rvm-shell: No such file or directory error

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

Problem

When trying to set up the capistrano deploy recipe to deploy to the vagrant virtual box as described in ‘Deploying rails’, you get the error:

when you have installed rvm system wide on the virtual box.

Solution

Make sure that you add the following into your deploy.rb file to set up the path for rvm:

Solution taken from here

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: