Puppet Class: pupmod::master::sysconfig
- Inherits:
- pupmod
- Defined in:
- manifests/master/sysconfig.pp
Overview
This class provides the sysconfig settings for the “puppetserver“ daemon.
to use. To use the default enter ‘default’. (Does not affect PE.)
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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'manifests/master/sysconfig.pp', line 67
class pupmod::master::sysconfig (
Stdlib::AbsolutePath $install_dir,
Stdlib::AbsolutePath $config,
Array[Stdlib::AbsolutePath] $bootstrap_config,
Stdlib::AbsolutePath $java_bin = '/usr/bin/java',
Optional[Pupmod::Memory] $java_start_memory = undef,
Optional[Pupmod::Memory] $java_max_memory = undef,
Optional[Stdlib::AbsolutePath] $java_temp_dir = undef,
String $jruby_jar = 'jruby-9k.jar',
Optional[Array[String]] $extra_java_args = undef,
Boolean $use_code_cache_flushing = true,
Integer[0] $reserved_code_cache = pupmod::reserved_code_cache(),
Integer $service_stop_retries = 60,
Integer $start_timeout = 120,
Simplib::ServerDistribution $server_distribution = pupmod::server_distribution(),
String $user = pick($facts.dig('puppet_settings','server','user'),$facts.dig('puppet_settings','master','user')),
String $group = pick($facts.dig('puppet_settings','server','group'),$facts.dig('puppet_settings','master','group')),
Boolean $mock = false
) inherits pupmod {
include 'pupmod::master::service'
unless $mock {
if ($server_distribution == 'PE') or defined(Class['puppet_enterprise::profile::master']) {
# If this is PE use the PE default for this run since the variable won't exist
$_tuning_max_active_instances = max(($facts['processors']['count'] - 1), 1)
} else {
$_tuning_max_active_instances = $pupmod::master::max_active_instances
}
$_java_max_memory = $java_max_memory.lest || { pupmod::java_max_memory($_tuning_max_active_instances) }
# In Puppet 6.19 the section "master was renamed to "server" in Puppet.settings.
# pick is used here to determine correct value for backwards compatability
$_server_datadir = pick($facts.dig('puppet_settings','server','server_datadir'),$facts.dig('puppet_settings','master','server_datadir'))
$_java_temp_dir = $java_temp_dir.empty ? {
# puppet_settings.master.server_datadir is not always present, but its parent is
true => "${_server_datadir.dirname}/pserver_tmp",
default => $java_temp_dir,
}
file { $_java_temp_dir:
ensure => 'directory',
owner => $user,
group => $group,
mode => '0750'
}
if ($server_distribution == 'PE') {
if 'pe_build' in $facts.keys {
if (SemVer($facts['pe_build']) < SemVer('2016.4.0')) {
['JAVA_ARGS', 'JAVA_ARGS_CLI'].each |String $setting| {
pe_ini_subsetting { "pupmod::master::sysconfig::javatempdir for ${setting}":
path => '/etc/sysconfig/pe-puppetserver',
section => '',
setting => $setting,
subsetting => '-Djava.io.tmpdir',
quote_char => '"',
value => "=${_java_temp_dir}",
key_val_separator => '=',
notify => Class['pupmod::master::service']
}
}
}
}
}
else {
# Use alternate jruby file only if file exists
# in the installation directory defined in the puppetserver_jruby fact.
if $jruby_jar != 'default' and $facts['puppetserver_jruby'] {
$_jruby_jar = member($facts['puppetserver_jruby']['jarfiles'], $jruby_jar) ? {
true => "${facts['puppetserver_jruby']['dir']}/${jruby_jar}",
false => 'default'
}
} else {
$_jruby_jar = 'default'
}
file { "/etc/sysconfig/${pupmod::master::service::service_name}":
owner => 'root',
group => $group,
mode => '0640',
content => epp("${module_name}/etc/sysconfig/puppetserver"),
notify => Class['pupmod::master::service']
}
}
}
}
|