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, puppetdb_service => $puppetdb_service,
manage_redhat_firewall => $manage_redhat_firewall, manage_redhat_firewall => $manage_redhat_firewall,
confdir => $confdir, confdir => $confdir,
java_args => $java_args, java_args => $java_args,
} }
if ($database == 'postgres') { if ($database == 'postgres') {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,7 +33,7 @@
# #
class puppetdb::server::jetty_ini( class puppetdb::server::jetty_ini(
$listen_address = $puppetdb::params::listen_address, $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_address = $puppetdb::params::ssl_listen_address,
$ssl_listen_port = $puppetdb::params::ssl_listen_port, $ssl_listen_port = $puppetdb::params::ssl_listen_port,
$disable_ssl = $puppetdb::params::disable_ssl, $disable_ssl = $puppetdb::params::disable_ssl,

View file

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