Puppet Class: psick::ruby::rbenv

Defined in:
manifests/ruby/rbenv.pp

Overview

Parameters:

  • module (Enum['jdowning']) (defaults to: 'jdowning')

    The name of the module to use to manage rbenv. Currently only jdowning/rbenv supported.

  • default_ruby_version (Optional[String]) (defaults to: undef)

    Default ruby version to use under rbenv. When set (default is ‘2.4.2’) the relevant rbenv::build is created

  • Where

    rbenv will be installed to.

  • owner (Optional[String]) (defaults to: undef)

    This defines who owns the rbenv install directory.

  • group (Optional[String]) (defaults to: undef)

    This defines the group membership for rbenv.

  • latest (Optional[String]) (defaults to: undef)

    This defines whether the rbenv $install_dir is kept up-to-date.

  • plugin_hash (Hash) (defaults to: {})

    An hash of resources data to be passed to rbenv::plugin

  • build_hash (Hash) (defaults to: {})

    An hash of resources data to be passed to rbenv::build

  • gem_hash (Hash) (defaults to: {})

    An hash of resources data to be passed to rbenv::gem

  • auto_prereq (Boolean) (defaults to: $psick::auto_prereq)

    If to automatically install eventual dependencies required by this class. Set to false if you have problems with duplicated resources. If so, you’ll need to ensure the needed prerequisites are present.

  • manage (Boolean) (defaults to: $psick::manage)

    If to actually manage any resource in this class. If false no resource is managed. Default value is taken from main psick class.

  • noop_manage (Boolean) (defaults to: $psick::noop_manage)

    If to use the noop() function for all the resources provided by this class. If this is true the noop function is called with $noop_value argument. This overrides any other noop setting (either set on client’s puppet.conf or by noop() function in main psick class). Default from psick class.

  • noop_value (Boolean) (defaults to: $psick::noop_value)

    The value to pass to noop() function if noop_manage is true. It applies to all the resources (and classes) declared in this class If true: noop metaparamenter is set to true, resources are not applied If false: noop metaparameter is set to false, and any eventual noop setting is overridden: resources are always applied. Default from psick class.

  • ensure (Variant[Boolean,String]) (defaults to: present)
  • install_dir (Optional[String]) (defaults to: undef)


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'manifests/ruby/rbenv.pp', line 31

class psick::ruby::rbenv (

  Variant[Boolean,String] $ensure        = present,
  Enum['jdowning'] $module               = 'jdowning',

  Optional[String] $default_ruby_version = undef,
  Optional[String] $install_dir          = undef,
  Optional[String] $owner                = undef,
  Optional[String] $group                = undef,
  Optional[String] $latest               = undef,

  Hash $plugin_hash                      = {},
  Hash $build_hash                       = {},
  Hash $gem_hash                         = {},

  Boolean $manage                        = $psick::manage,
  Boolean $auto_prereq                   = $psick::auto_prereq,
  Boolean $noop_manage                   = $psick::noop_manage,
  Boolean $noop_value                    = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }

    # Installation management
    case $module {
      'jdowning': {
        class { 'rbenv':
          manage_deps => $auto_prereq,
          install_dir => $install_dir,
          owner       => $owner,
          group       => $group,
          latest      => $latest,
        }
        $default_gem_options = delete_undef_values({
            ruby_version => $default_ruby_version,
        })
        if $default_ruby_version and $auto_prereq {
          rbenv::plugin { 'rbenv/ruby-build': }
          rbenv::build { $default_ruby_version:
            global => true,
          }
        }
        $plugin_hash.each |$k,$v| {
          rbenv::plugin { $k:
            * => $v,
          }
        }
        $build_hash.each |$k,$v| {
          rbenv::build { $k:
            * => $v,
          }
        }
        $gem_hash.each |$k,$v| {
          rbenv::gem { $k:
            * => $default_gem_options + $v,
          }
        }
      }
      default: {
        contain rbenv
      }
    }
  }
}