Sha256: 1a0cea4fd495034051007736de2eb2ffe04a68b22f90cd33828aa2d45af06e03

Contents?: true

Size: 1.02 KB

Versions: 12

Compression:

Stored size: 1.02 KB

Contents

define rbenv::plugin(
  $user,
  $source,
  $plugin_name = $title,
  $group       = $user,
  $home        = '',
  $root        = '',
  $timeout     = 100
) {

  $home_path   = $home ? { '' => "/home/${user}",       default => $home }
  $root_path   = $root ? { '' => "${home_path}/.rbenv", default => $root }
  $plugins     = "${root_path}/plugins"
  $destination = "${plugins}/${plugin_name}"

  if $source !~ /^git:/ {
    fail('Only git plugins are supported')
  }

  if ! defined(File["rbenv::plugins ${user}"]) {
    file { "rbenv::plugins ${user}":
      ensure  => directory,
      path    => $plugins,
      owner   => $user,
      group   => $group,
      require => Exec["rbenv::checkout ${user}"],
    }
  }

  exec { "rbenv::plugin::checkout ${user} ${plugin_name}":
    command => "git clone ${source} ${destination}",
    user    => $user,
    group   => $group,
    creates => $destination,
    path    => ['/usr/bin', '/usr/sbin'],
    timeout => $timeout,
    cwd => $home_path,
    require => File["rbenv::plugins ${user}"],
  }
}

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
bebox-0.0.1 lib/templates/puppet/step-0/modules/rbenv/manifests/plugin.pp
freighthop-0.6.1 modules/rbenv/manifests/plugin.pp
freighthop-0.6.0 modules/rbenv/manifests/plugin.pp
freighthop-0.5.2 modules/rbenv/manifests/plugin.pp
freighthop-0.5.1 modules/rbenv/manifests/plugin.pp
freighthop-0.5.0 modules/rbenv/manifests/plugin.pp
freighthop-0.4.1 modules/rbenv/manifests/plugin.pp
freighthop-0.4.0 modules/rbenv/manifests/plugin.pp
freighthop-0.3.3 modules/rbenv/manifests/plugin.pp
freighthop-0.3.2 modules/rbenv/manifests/plugin.pp
freighthop-0.3.1 modules/rbenv/manifests/plugin.pp
freighthop-0.3.0 modules/rbenv/manifests/plugin.pp