Style guideline fixes

This commit is contained in:
Erik Dalén 2013-06-04 14:19:53 +02:00
parent b45fca9689
commit 02d0c48438
8 changed files with 47 additions and 44 deletions

View file

@ -168,7 +168,7 @@ class puppetdb(
puppetdb_service => $puppetdb_service,
manage_redhat_firewall => $manage_redhat_firewall,
confdir => $confdir,
java_args => $java_args,
java_args => $java_args,
}
if ($database == 'postgres') {

View file

@ -82,20 +82,20 @@ class puppetdb::master::config(
}
if ($strict_validation) {
# 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 },
timeout => $puppetdb_startup_timeout,
require => Package[$terminus_package],
}
# 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 },
timeout => $puppetdb_startup_timeout,
require => Package[$terminus_package],
}
# This is a bit of puppet chicanery that allows us to create a
# conditional dependency. Basically, we're saying that "if the PuppetDB
# service is being managed in this same catalog, it needs to come before
# this validator."
Service<|title == $puppetdb::params::puppetdb_service|> -> Puppetdb_conn_validator['puppetdb_conn']
# This is a bit of puppet chicanery that allows us to create a
# conditional dependency. Basically, we're saying that "if the PuppetDB
# service is being managed in this same catalog, it needs to come before
# this validator."
Service<|title == $puppetdb::params::puppetdb_service|> -> Puppetdb_conn_validator['puppetdb_conn']
}
# Conditionally manage the `routes.yaml` file. Restart the puppet service
@ -122,21 +122,21 @@ class puppetdb::master::config(
# because it polls it automatically.
if ($manage_report_processor) {
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] },
puppet_conf => $puppet_conf,
enable => $enable_reports,
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
}
}
if ($manage_config) {
# Manage the `puppetdb.conf` file. Restart the puppet service if changes
# are made.
class { 'puppetdb::master::puppetdb_conf':
server => $puppetdb_server,
port => $puppetdb_port,
puppet_confdir => $puppet_confdir,
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
}
# Manage the `puppetdb.conf` file. Restart the puppet service if changes
# are made.
class { 'puppetdb::master::puppetdb_conf':
server => $puppetdb_server,
port => $puppetdb_port,
puppet_confdir => $puppet_confdir,
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
}
}
if ($restart_puppet) {

View file

@ -2,7 +2,7 @@
#
# This class configures the puppet master to enable the puppetdb report
# processor
#
# Parameters:
# ['puppet_conf'] - The puppet config file (defaults to /etc/puppet/puppet.conf)
#
@ -24,12 +24,15 @@ class puppetdb::master::report_processor(
$enable = false
) inherits puppetdb::params {
ini_subsetting { "puppet.conf/reports/puppetdb":
path => $puppet_conf,
section => 'master',
setting => 'reports',
subsetting => 'puppetdb',
subsetting_separator => ',',
ensure => $enable ? { true => present, default => absent }
ini_subsetting { 'puppet.conf/reports/puppetdb':
ensure => $enable ? {
true => present,
default => absent
},
path => $puppet_conf,
section => 'master',
setting => 'reports',
subsetting => 'puppetdb',
subsetting_separator => ','
}
}

View file

@ -78,7 +78,7 @@ class puppetdb::params {
$puppet_confdir = '/etc/puppetlabs/puppet'
$terminus_package = 'pe-puppetdb-terminus'
$embedded_subname = 'file:/opt/puppet/share/puppetdb/db/db;hsqldb.tx=mvcc;sql.syntax_pgs=true'
case $::osfamily {
'RedHat': {
$puppetdb_initconf = '/etc/sysconfig/pe-puppetdb'
@ -89,7 +89,7 @@ class puppetdb::params {
default: {
fail("${module_name} supports osfamily's RedHat and Debian. Your osfamily is recognized as ${::osfamily}")
}
}
}
} else {
$puppetdb_package = 'puppetdb'
$puppetdb_service = 'puppetdb'
@ -98,7 +98,7 @@ class puppetdb::params {
$puppet_confdir = '/etc/puppet'
$terminus_package = 'puppetdb-terminus'
$embedded_subname = 'file:/usr/share/puppetdb/db/db;hsqldb.tx=mvcc;sql.syntax_pgs=true'
case $::osfamily {
'RedHat': {
$puppetdb_initconf = '/etc/sysconfig/puppetdb'

View file

@ -190,7 +190,7 @@ class puppetdb::server(
}
if !empty($java_args) {
create_resources(
'ini_subsetting',
puppetdb_create_subsetting_resource_hash(

View file

@ -1,6 +1,6 @@
class puppetdb::server::firewall(
$port = '',
$http_port = $puppetdb::params::listen_port,
$http_port = $puppetdb::params::listen_port,
$open_http_port = $puppetdb::params::open_listen_port,
$ssl_port = $puppetdb::params::ssl_listen_port,
$open_ssl_port = $puppetdb::params::open_ssl_listen_port,
@ -27,7 +27,7 @@ class puppetdb::server::firewall(
Firewall {
notify => Exec['puppetdb-persist-firewall']
}
if ($port) {
notify { 'Deprecation notice: `port` parameter will be removed in future versions of the puppetdb module. Please use ssl_port instead.': }
}
@ -35,7 +35,7 @@ class puppetdb::server::firewall(
if ($port and $ssl_port) {
fail('`port` and `ssl_port` cannot both be defined. `port` is deprecated in favor of `ssl_port`')
}
if ($open_http_port) {
firewall { "${http_port} accept - puppetdb":
port => $http_port,

View file

@ -33,7 +33,7 @@
#
class puppetdb::server::jetty_ini(
$listen_address = $puppetdb::params::listen_address,
$listen_port = $puppetdb::params::listen_port,
$listen_port = $puppetdb::params::listen_port,
$ssl_listen_address = $puppetdb::params::ssl_listen_address,
$ssl_listen_port = $puppetdb::params::ssl_listen_port,
$disable_ssl = $puppetdb::params::disable_ssl,

View file

@ -11,7 +11,7 @@ node puppet {
# This node is our postgres server
node puppetdb-postgres {
# Here we install and configure postgres and the puppetdb database instance
# Optionally, open the firewall port for postgres so puppetdb server can
# Optionally, open the firewall port for postgres so puppetdb server can
# gain access.
class { 'puppetdb::database::postgresql':
listen_addresses => 'puppetdb-postgres',
@ -23,8 +23,8 @@ node puppetdb-postgres {
node puppetdb {
# Here we install and configure the puppetdb server, and tell it where to
# find the postgres database.
# Set open_ssl_listen_port to allow the puppet master to gain access to
# puppetdb. Optionally, set open_listen_port to open the HTTP port so
# Set open_ssl_listen_port to allow the puppet master to gain access to
# puppetdb. Optionally, set open_listen_port to open the HTTP port so
# you can access the PuppetDB dashboard.
class { 'puppetdb::server':
database_host => 'puppetdb-postgres',