Sha256: e609312e8af94cb84830814c169bc8cbb7700cd4eb5e7636d5e58efdad046fdc

Contents?: true

Size: 870 Bytes

Versions: 2

Compression:

Stored size: 870 Bytes

Contents

class freighthop::rbenv(
  $ruby_version
) {
  include apt
  apt::ppa { 'ppa:gds/govuk': }
  apt::ppa { 'ppa:phinze/rbenv': }

  class { '::rbenv':
    global_version => $ruby_version,
    require        => Apt::Ppa['ppa:gds/govuk'],
  }

  rbenv::version { $ruby_version: }

  # The rbenv puppet module drops $RBENV_ROOT/version but the package from
  # ppa:gds/govuk is an older version of rbenv that expects $RBENV_ROOT/global;
  # this is a workaround that uses the installed CLI to fix it.
  exec { 'fix-rbenv-global-version':
    command     => "rbenv global ${ruby_version}",
    unless      => "rbenv global | grep '${ruby_version}'",
    environment => 'RBENV_ROOT=/usr/lib/rbenv',
    require     => Rbenv::Version[$ruby_version]
  }

  Exec {
    path => [
      '/usr/local/bin',
      '/usr/bin',
      '/usr/sbin',
      '/bin',
      '/sbin',
    ]
  }
}

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
freighthop-0.0.1 local_modules/freighthop/manifests/rbenv.pp
freighthop-0.0.1 modules/freighthop/manifests/rbenv.pp