Ask Your Question
0

exec rvm install - permission denied?

asked 2014-02-06 15:18:18 -0500

ericfrancis gravatar image

updated 2014-02-06 15:20:30 -0500

Why would exampleuser not have the require permission to write to /home/exampleuser?

I have this in my default.pp:

$user = example_user

user { $user :
ensure      => present,
managehome  => true, # creates home directory
shell       => "/bin/bash"
}

exec { "curl -sSL https://get.rvm.io | bash -s stable":
unless      => "[ -d /home/${user}/.rvm];",
path        => "/usr/bin:/usr/sbin:/bin",
user        => $user,
cwd         => "/home/${user}/",
logoutput   => true,
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-06 16:25:07 -0500

ericfrancis gravatar image

After looking through some github repos, I think my issue was environment => ["HOME=/home/$user"], and not having the correct packages installed.

$rvm    = ["libyaml-devel", "libffi-devel", "readline-devel", "zlib-devel", "openssl-devel"]

package { [ $core, $rvm ]:
ensure  => installed,
}

exec { "curl -sSL https://get.rvm.io | bash -s stable --ruby=1.9.3":
unless      => "[ -d /home/${user}/.rvm/ ]",
path        => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
user        => $user,
cwd         => "/home/${user}/",
environment => ["HOME=/home/$user"],
logoutput   => true,
require     => Package[ $rvm ],
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-02-06 15:18:18 -0500

Seen: 401 times

Last updated: Feb 06 '14