Puppet Class: r10k::install
- Inherits:
- r10k::params
- Defined in:
- manifests/install.pp
Overview
This class is used by the ruby or pe_ruby class
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 |
# File 'manifests/install.pp', line 2
class r10k::install (
$package_name,
$version,
$provider,
$keywords,
$install_options,
$manage_ruby_dependency,
$puppet_master = true,
$is_pe_server = $r10k::params::is_pe_server,
Optional[String[1]] $gem_source = undef,
) inherits r10k::params {
if $package_name == '' {
case $provider {
'openbsd': {
if (versioncmp("${::kernelversion}", '5.8') < 0) { #lint:ignore:only_variable_string
$real_package_name = 'ruby21-r10k'
} else {
$real_package_name = 'ruby22-r10k'
}
}
default: { $real_package_name = 'r10k' }
}
} else {
$real_package_name = $package_name
}
case $provider {
'bundle': {
include r10k::install::bundle
}
'puppet_gem', 'gem', 'openbsd': {
if $provider == 'gem' {
class { 'r10k::install::gem':
manage_ruby_dependency => $manage_ruby_dependency,
version => $version;
}
}
elsif $provider == 'puppet_gem' {
# Puppet FOSS 4.2 and up ships a vendor provided ruby.
# Using puppet_gem uses that instead of the system ruby.
include r10k::install::puppet_gem
}
# Currently we share a package resource to keep things simple
# Puppet seems to have a bug (see #87 ) related to passing an
# empty to value to the gem providers This code
# converts an empty array to semi-standard gem options
# This was previously undef but that caused strict var issues
if $provider in ['puppet_gem', 'gem'] and $install_options == [] {
$provider_install_options = ['--no-ri', '--no-rdoc']
} else {
$provider_install_options = $install_options
}
# Puppet Enterprise 3.8 and ships an embedded r10k so thats all thats supported
# This conditional should not effect FOSS customers based on the fact
package { $real_package_name:
ensure => $version,
provider => $provider,
source => $gem_source,
install_options => $provider_install_options,
}
}
default: { fail("${module_name}: ${provider} is not supported. Valid values are: 'gem', 'puppet_gem', 'bundle', 'openbsd'") }
}
}
|