Skip to content

Commit

Permalink
Add a client resource defining an user that shares an rbenv installation
Browse files Browse the repository at this point in the history
  • Loading branch information
vjt authored and System Administrator (on puppet.ifad.org) committed Aug 1, 2012
1 parent a8ba190 commit 4136045
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions manifests/client.pp
@@ -0,0 +1,47 @@
define rbenv::client(
$user,
$home,
$ruby,
$owner,
$source,
) {
if ! defined(Exec["rbenv::compile ${owner} ${ruby}"]) {
fail("Ruby version ${ruby} is not compiled for ${owner}")
}

file {"${user}/.rbenv":
ensure => link,
path => "${home}/.rbenv",
target => "${source}/.rbenv",
}

file {"${user}/.bashrc":
ensure => link,
path => "${home}/.bashrc",
target => "${source}/.bashrc",
}

file {"${user}/.gemrc":
ensure => link,
path => "${home}/.gemrc",
target => "${source}/.gemrc",
}

file {"${user}/.rbenv-version":
ensure => present,
path => "${home}/.rbenv-version",
content => "$ruby\n",
}

file {"${user}/bin":
ensure => directory,
path => "${home}/bin",
owner => $user,
}

file {"${user}/bin/rbenv":
ensure => link,
path => "${home}/bin/rbenv",
target => "${source}/.rbenv/bin/rbenv",
}
}

0 comments on commit 4136045

Please sign in to comment.