Fix some Puppet Lint errors
Fix wrong indention
This commit is contained in:
parent
ed6579b6ea
commit
9d607f55f3
4 changed files with 88 additions and 67 deletions
|
@ -75,60 +75,60 @@ class puppetdb(
|
|||
validate_re ($report_ttl_real, ['^\d+(d|h|m|s|ms)$'], "report_ttl is <${report_ttl}> which does not match the regex validation")
|
||||
|
||||
# Validate puppetdb_service_status
|
||||
if !($puppetdb_service_status in ['true', 'running', 'false', 'stopped']) {
|
||||
if !($puppetdb_service_status in [true, 'running', false, 'stopped']) {
|
||||
fail("puppetdb_service_status valid values are 'true', 'running', 'false', and 'stopped'. You provided '${puppetdb_service_status}'")
|
||||
}
|
||||
|
||||
class { 'puppetdb::server':
|
||||
listen_address => $listen_address,
|
||||
listen_port => $listen_port,
|
||||
open_listen_port => $open_listen_port,
|
||||
ssl_listen_address => $ssl_listen_address,
|
||||
ssl_listen_port => $ssl_listen_port,
|
||||
disable_ssl => $disable_ssl,
|
||||
open_ssl_listen_port => $open_ssl_listen_port,
|
||||
database => $database,
|
||||
database_port => $database_port,
|
||||
database_username => $database_username,
|
||||
database_password => $database_password,
|
||||
database_name => $database_name,
|
||||
database_ssl => $database_ssl,
|
||||
node_ttl => $node_ttl,
|
||||
node_purge_ttl => $node_purge_ttl,
|
||||
report_ttl => $report_ttl,
|
||||
gc_interval => $gc_interval,
|
||||
log_slow_statements => $log_slow_statements,
|
||||
conn_max_age => $conn_max_age,
|
||||
conn_keep_alive => $conn_keep_alive,
|
||||
conn_lifetime => $conn_lifetime,
|
||||
puppetdb_package => $puppetdb_package,
|
||||
puppetdb_version => $puppetdb_version,
|
||||
puppetdb_service => $puppetdb_service,
|
||||
puppetdb_service_status => $puppetdb_service_status,
|
||||
confdir => $confdir,
|
||||
java_args => $java_args,
|
||||
max_threads => $max_threads,
|
||||
read_database => $read_database,
|
||||
read_database_host => $read_database_host,
|
||||
read_database_port => $read_database_port,
|
||||
read_database_username => $read_database_username,
|
||||
read_database_password => $read_database_password,
|
||||
read_database_name => $read_database_name,
|
||||
read_database_ssl => $read_database_ssl,
|
||||
listen_address => $listen_address,
|
||||
listen_port => $listen_port,
|
||||
open_listen_port => $open_listen_port,
|
||||
ssl_listen_address => $ssl_listen_address,
|
||||
ssl_listen_port => $ssl_listen_port,
|
||||
disable_ssl => $disable_ssl,
|
||||
open_ssl_listen_port => $open_ssl_listen_port,
|
||||
database => $database,
|
||||
database_port => $database_port,
|
||||
database_username => $database_username,
|
||||
database_password => $database_password,
|
||||
database_name => $database_name,
|
||||
database_ssl => $database_ssl,
|
||||
node_ttl => $node_ttl,
|
||||
node_purge_ttl => $node_purge_ttl,
|
||||
report_ttl => $report_ttl,
|
||||
gc_interval => $gc_interval,
|
||||
log_slow_statements => $log_slow_statements,
|
||||
conn_max_age => $conn_max_age,
|
||||
conn_keep_alive => $conn_keep_alive,
|
||||
conn_lifetime => $conn_lifetime,
|
||||
puppetdb_package => $puppetdb_package,
|
||||
puppetdb_version => $puppetdb_version,
|
||||
puppetdb_service => $puppetdb_service,
|
||||
puppetdb_service_status => $puppetdb_service_status,
|
||||
confdir => $confdir,
|
||||
java_args => $java_args,
|
||||
max_threads => $max_threads,
|
||||
read_database => $read_database,
|
||||
read_database_host => $read_database_host,
|
||||
read_database_port => $read_database_port,
|
||||
read_database_username => $read_database_username,
|
||||
read_database_password => $read_database_password,
|
||||
read_database_name => $read_database_name,
|
||||
read_database_ssl => $read_database_ssl,
|
||||
read_log_slow_statements => $read_log_slow_statements,
|
||||
read_conn_max_age => $read_conn_max_age,
|
||||
read_conn_keep_alive => $read_conn_keep_alive,
|
||||
read_conn_lifetime => $read_conn_lifetime,
|
||||
read_conn_max_age => $read_conn_max_age,
|
||||
read_conn_keep_alive => $read_conn_keep_alive,
|
||||
read_conn_lifetime => $read_conn_lifetime,
|
||||
}
|
||||
|
||||
if ($database == 'postgres') {
|
||||
class { 'puppetdb::database::postgresql':
|
||||
listen_addresses => $database_listen_address,
|
||||
database_name => $database_name,
|
||||
database_username => $database_username,
|
||||
database_password => $database_password,
|
||||
manage_server => $manage_dbserver,
|
||||
before => [Class['puppetdb::server'],Class['puppetdb::server::validate_db']],
|
||||
listen_addresses => $database_listen_address,
|
||||
database_name => $database_name,
|
||||
database_username => $database_username,
|
||||
database_password => $database_password,
|
||||
manage_server => $manage_dbserver,
|
||||
before => [Class['puppetdb::server'],Class['puppetdb::server::validate_db']],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,9 +29,18 @@ class puppetdb::master::config(
|
|||
# Validate the puppetdb connection. If we can't connect to puppetdb then we
|
||||
# *must* not perform the other configuration steps, or else
|
||||
puppetdb_conn_validator { 'puppetdb_conn':
|
||||
puppetdb_server => $manage_config ? { true => $puppetdb_server, default => undef },
|
||||
puppetdb_port => $manage_config ? { true => $puppetdb_port, default => undef },
|
||||
use_ssl => $puppetdb_port ? { 8080 => false, default => true },
|
||||
puppetdb_server => $manage_config ? {
|
||||
true => $puppetdb_server,
|
||||
default => undef,
|
||||
},
|
||||
puppetdb_port => $manage_config ? {
|
||||
true => $puppetdb_port,
|
||||
default => undef,
|
||||
},
|
||||
use_ssl => $puppetdb_port ? {
|
||||
8080 => false,
|
||||
default => true,
|
||||
},
|
||||
timeout => $puppetdb_startup_timeout,
|
||||
require => Package[$terminus_package],
|
||||
}
|
||||
|
@ -48,7 +57,10 @@ class puppetdb::master::config(
|
|||
if ($manage_routes) {
|
||||
class { 'puppetdb::master::routes':
|
||||
puppet_confdir => $puppet_confdir,
|
||||
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
|
||||
require => $strict_validation ? {
|
||||
true => Puppetdb_conn_validator['puppetdb_conn'],
|
||||
default => Package[$terminus_package],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +70,10 @@ class puppetdb::master::config(
|
|||
if ($manage_storeconfigs) {
|
||||
class { 'puppetdb::master::storeconfigs':
|
||||
puppet_conf => $puppet_conf,
|
||||
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
|
||||
require => $strict_validation ? {
|
||||
true => Puppetdb_conn_validator['puppetdb_conn'],
|
||||
default => Package[$terminus_package],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +84,10 @@ class puppetdb::master::config(
|
|||
class { 'puppetdb::master::report_processor':
|
||||
puppet_conf => $puppet_conf,
|
||||
enable => $enable_reports,
|
||||
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
|
||||
require => $strict_validation ? {
|
||||
true => Puppetdb_conn_validator['puppetdb_conn'],
|
||||
default => Package[$terminus_package],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +99,10 @@ class puppetdb::master::config(
|
|||
port => $puppetdb_port,
|
||||
soft_write_failure => $puppetdb_soft_write_failure,
|
||||
puppet_confdir => $puppet_confdir,
|
||||
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
|
||||
require => $strict_validation ? {
|
||||
true => Puppetdb_conn_validator['puppetdb_conn'],
|
||||
default => Package[$terminus_package],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class puppetdb::params {
|
|||
}
|
||||
}
|
||||
|
||||
if defined('$::is_pe') and $::is_pe == 'true' {
|
||||
if defined('$::is_pe') and $::is_pe == true {
|
||||
$puppetdb_package = 'pe-puppetdb'
|
||||
$puppetdb_service = 'pe-puppetdb'
|
||||
$confdir = '/etc/puppetlabs/puppetdb/conf.d'
|
||||
|
|
|
@ -74,7 +74,7 @@ class puppetdb::server(
|
|||
validate_re ($report_ttl_real, ['^\d+(d|h|m|s|ms)$'], "report_ttl is <${report_ttl}> which does not match the regex validation")
|
||||
|
||||
# Validate puppetdb_service_status
|
||||
if !($puppetdb_service_status in ['true', 'running', 'false', 'stopped']) {
|
||||
if !($puppetdb_service_status in [true, 'running', false, 'stopped']) {
|
||||
fail("puppetdb_service_status valid values are 'true', 'running', 'false', and 'stopped'. You provided '${puppetdb_service_status}'")
|
||||
}
|
||||
|
||||
|
@ -91,10 +91,10 @@ class puppetdb::server(
|
|||
if $manage_firewall {
|
||||
|
||||
class { 'puppetdb::server::firewall':
|
||||
http_port => $listen_port,
|
||||
open_http_port => $open_listen_port,
|
||||
ssl_port => $ssl_listen_port,
|
||||
open_ssl_port => $open_ssl_listen_port,
|
||||
http_port => $listen_port,
|
||||
open_http_port => $open_listen_port,
|
||||
ssl_port => $ssl_listen_port,
|
||||
open_ssl_port => $open_ssl_listen_port,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,14 +135,14 @@ class puppetdb::server(
|
|||
}
|
||||
|
||||
class { 'puppetdb::server::jetty_ini':
|
||||
listen_address => $listen_address,
|
||||
listen_port => $listen_port,
|
||||
ssl_listen_address => $ssl_listen_address,
|
||||
ssl_listen_port => $ssl_listen_port,
|
||||
disable_ssl => $disable_ssl,
|
||||
confdir => $confdir,
|
||||
max_threads => $max_threads,
|
||||
notify => Service[$puppetdb_service],
|
||||
listen_address => $listen_address,
|
||||
listen_port => $listen_port,
|
||||
ssl_listen_address => $ssl_listen_address,
|
||||
ssl_listen_port => $ssl_listen_port,
|
||||
disable_ssl => $disable_ssl,
|
||||
confdir => $confdir,
|
||||
max_threads => $max_threads,
|
||||
notify => Service[$puppetdb_service],
|
||||
}
|
||||
|
||||
if !empty($java_args) {
|
||||
|
@ -173,7 +173,7 @@ class puppetdb::server(
|
|||
enable => $service_enabled,
|
||||
}
|
||||
|
||||
if $manage_firewall {
|
||||
if $manage_firewall {
|
||||
Package[$puppetdb_package] ->
|
||||
Class['puppetdb::server::firewall'] ->
|
||||
Class['puppetdb::server::database_ini'] ->
|
||||
|
|
Loading…
Reference in a new issue