module-puppetdb/manifests/server/jetty_ini.pp

93 lines
2.4 KiB
ObjectPascal
Raw Normal View History

# PRIVATE CLASS - do not use directly
class puppetdb::server::jetty_ini (
$listen_address = $puppetdb::params::listen_address,
2013-06-04 14:19:53 +02:00
$listen_port = $puppetdb::params::listen_port,
2012-09-20 23:46:26 +02:00
$ssl_listen_address = $puppetdb::params::ssl_listen_address,
$ssl_listen_port = $puppetdb::params::ssl_listen_port,
$disable_ssl = $puppetdb::params::disable_ssl,
$ssl_set_cert_paths = $puppetdb::params::ssl_set_cert_paths,
$ssl_cert_path = $puppetdb::params::ssl_cert_path,
$ssl_key_path = $puppetdb::params::ssl_key_path,
$ssl_ca_cert_path = $puppetdb::params::ssl_ca_cert_path,
$ssl_protocols = $puppetdb::params::ssl_protocols,
2012-09-20 23:46:26 +02:00
$confdir = $puppetdb::params::confdir,
2014-06-26 17:15:34 +02:00
$max_threads = $puppetdb::params::max_threads,
) inherits puppetdb::params {
2012-09-20 23:46:26 +02:00
# Set the defaults
Ini_setting {
2012-09-20 23:46:26 +02:00
path => "${confdir}/jetty.ini",
ensure => present,
section => 'jetty',
}
ini_setting { 'puppetdb_host':
setting => 'host',
value => $listen_address,
}
ini_setting { 'puppetdb_port':
setting => 'port',
value => $listen_port,
}
$ssl_setting_ensure = $disable_ssl ? {
true => 'absent',
default => 'present',
}
ini_setting { 'puppetdb_sslhost':
ensure => $ssl_setting_ensure,
setting => 'ssl-host',
value => $ssl_listen_address,
}
ini_setting { 'puppetdb_sslport':
ensure => $ssl_setting_ensure,
setting => 'ssl-port',
value => $ssl_listen_port,
}
if $ssl_protocols != undef {
validate_string($ssl_protocols)
ini_setting { 'puppetdb_sslprotocols':
ensure => $ssl_setting_ensure,
setting => 'ssl-protocols',
value => $ssl_protocols,
}
}
if str2bool($ssl_set_cert_paths) == true {
# assume paths have been validated in calling class
ini_setting { 'puppetdb_ssl_key':
ensure => present,
setting => 'ssl-key',
value => $ssl_key_path,
}
ini_setting { 'puppetdb_ssl_cert':
ensure => present,
setting => 'ssl-cert',
value => $ssl_cert_path,
}
ini_setting { 'puppetdb_ssl_ca_cert':
ensure => present,
setting => 'ssl-ca-cert',
value => $ssl_ca_cert_path,
}
}
2014-06-26 17:15:34 +02:00
if ($max_threads) {
ini_setting { 'puppetdb_max_threads':
2014-06-26 17:15:34 +02:00
setting => 'max-threads',
value => $max_threads,
}
} else {
ini_setting { 'puppetdb_max_threads':
2014-06-26 17:15:34 +02:00
ensure => absent,
setting => 'max-threads',
}
}
}