Skip to content

Instantly share code, notes, and snippets.

@rtyler
Created May 8, 2012 16:34
Show Gist options
  • Save rtyler/2637045 to your computer and use it in GitHub Desktop.
Save rtyler/2637045 to your computer and use it in GitHub Desktop.
Installs rvm for a specific user
define rvm::install() {
exec {
"download rvm for ${name}" :
creates => "/home/${name}/.rvm/scripts/rvm",
cwd => "/home/${name}",
command => 'curl -L get.rvm.io -o install-rvm.sh',
user => $name,
path => ['/bin', '/usr/bin'],
notify => Exec["install rvm for ${name}"],
require => User[$name];
"install rvm for ${name}" :
creates => "/home/${name}/.rvm/scripts/rvm",
command => 'bash -s stable < install-rvm.sh',
cwd => "/home/${name}",
user => $name,
environment => ["HOME=/home/${name}"],
provider => shell,
logoutput => on_failure,
refreshonly => true,
path => ['/bin', '/usr/bin', '/sbin', '/usr/sbin'],
require => User[$name];
}
}
node default {
rvm::install {
'tyler' ; ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment