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
}
}
}
}
|