Merge pull request #89 from ghoneycutt/soft_write_failure

Add soft_write_failure to puppetdb.conf
This commit is contained in:
Ken Barber 2013-10-18 09:29:44 -07:00
commit 39e8f6c919
3 changed files with 44 additions and 29 deletions

View file

@ -319,6 +319,10 @@ The dns name or ip of the puppetdb server (defaults to the certname of the curre
The port that the puppetdb server is running on (defaults to 8081). The port that the puppetdb server is running on (defaults to 8081).
####`puppetdb_soft_write_failure`
Boolean to fail in a soft-manner if PuppetDB is not accessable for command submission (defaults to false).
####`manage_routes` ####`manage_routes`
If true, the module will overwrite the puppet master's routes file to configure it to use PuppetDB (defaults to true). If true, the module will overwrite the puppet master's routes file to configure it to use PuppetDB (defaults to true).

View file

@ -13,6 +13,8 @@
# ['puppetdb_server'] - The dns name or ip of the puppetdb server # ['puppetdb_server'] - The dns name or ip of the puppetdb server
# (defaults to the certname of the current node) # (defaults to the certname of the current node)
# ['puppetdb_port'] - The port that the puppetdb server is running on (defaults to 8081) # ['puppetdb_port'] - The port that the puppetdb server is running on (defaults to 8081)
# ['puppetdb_soft_write_failure'] - Boolean to fail in a soft-manner if PuppetDB is not
# accessable for command submission (defaults to false)
# ['manage_routes'] - If true, the module will overwrite the puppet master's routes # ['manage_routes'] - If true, the module will overwrite the puppet master's routes
# file to configure it to use puppetdb (defaults to true) # file to configure it to use puppetdb (defaults to true)
# ['manage_storeconfigs'] - If true, the module will manage the puppet master's # ['manage_storeconfigs'] - If true, the module will manage the puppet master's
@ -60,21 +62,22 @@
# TODO: finish porting this to use params # TODO: finish porting this to use params
# #
class puppetdb::master::config( class puppetdb::master::config(
$puppetdb_server = $::fqdn, $puppetdb_server = $::fqdn,
$puppetdb_port = 8081, $puppetdb_port = 8081,
$manage_routes = true, $puppetdb_soft_write_failure = false,
$manage_storeconfigs = true, $manage_routes = true,
$manage_report_processor = false, $manage_storeconfigs = true,
$manage_config = true, $manage_report_processor = false,
$strict_validation = true, $manage_config = true,
$enable_reports = false, $strict_validation = true,
$puppet_confdir = $puppetdb::params::puppet_confdir, $enable_reports = false,
$puppet_conf = $puppetdb::params::puppet_conf, $puppet_confdir = $puppetdb::params::puppet_confdir,
$puppetdb_version = $puppetdb::params::puppetdb_version, $puppet_conf = $puppetdb::params::puppet_conf,
$terminus_package = $puppetdb::params::terminus_package, $puppetdb_version = $puppetdb::params::puppetdb_version,
$puppet_service_name = $puppetdb::params::puppet_service_name, $terminus_package = $puppetdb::params::terminus_package,
$puppetdb_startup_timeout = $puppetdb::params::puppetdb_startup_timeout, $puppet_service_name = $puppetdb::params::puppet_service_name,
$restart_puppet = true $puppetdb_startup_timeout = $puppetdb::params::puppetdb_startup_timeout,
$restart_puppet = true
) inherits puppetdb::params { ) inherits puppetdb::params {
package { $terminus_package: package { $terminus_package:
@ -132,10 +135,11 @@ class puppetdb::master::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, soft_write_failure => $puppetdb_soft_write_failure,
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] }, puppet_confdir => $puppet_confdir,
require => $strict_validation ? { true => Puppetdb_conn_validator['puppetdb_conn'], default => Package[$terminus_package] },
} }
} }

View file

@ -1,11 +1,12 @@
# Class: puppetdb::master::puppetdb_conf # == Class: puppetdb::master::puppetdb_conf
# #
# This class manages the puppetdb.conf file for the puppet master. # This class manages the puppetdb.conf file for the puppet master.
# #
# Parameters: # Parameters:
# ['server'] - The dns name or ip of the puppetdb server (defaults to localhost) # ['server'] - The dns name or ip of the puppetdb server (defaults to localhost)
# ['port'] - The port that the puppetdb server is running on (defaults to 8081) # ['port'] - The port that the puppetdb server is running on (defaults to 8081)
# ['puppet_confdir'] - The config directory of puppet (defaults to /etc/puppet) # ['soft_write_failure'] - Boolean to fail in a soft-manner if PuppetDB is not accessable for command submission (defaults to false)
# ['puppet_confdir'] - The config directory of puppet (defaults to /etc/puppet)
# #
# Actions: # Actions:
# - Configures the required puppetdb settings for the puppet master by managing # - Configures the required puppetdb settings for the puppet master by managing
@ -16,15 +17,16 @@
# #
# Sample Usage: # Sample Usage:
# class { 'puppetdb::master::puppetdb_conf': # class { 'puppetdb::master::puppetdb_conf':
# server => 'my.puppetdb.server' # server => 'my.puppetdb.server'
# } # }
# #
# #
# TODO: finish porting this to use params # TODO: finish porting this to use params
# #
class puppetdb::master::puppetdb_conf( class puppetdb::master::puppetdb_conf (
$server = 'localhost', $server = 'localhost',
$port = '8081', $port = '8081',
$soft_write_failure = false,
$puppet_confdir = $puppetdb::params::puppet_confdir, $puppet_confdir = $puppetdb::params::puppet_confdir,
) inherits puppetdb::params { ) inherits puppetdb::params {
@ -34,13 +36,18 @@ class puppetdb::master::puppetdb_conf(
path => "${puppet_confdir}/puppetdb.conf", path => "${puppet_confdir}/puppetdb.conf",
} }
ini_setting {'puppetdbserver': ini_setting { 'puppetdbserver':
setting => 'server', setting => 'server',
value => $server, value => $server,
} }
ini_setting {'puppetdbport': ini_setting { 'puppetdbport':
setting => 'port', setting => 'port',
value => $port, value => $port,
} }
ini_setting { 'soft_write_failure':
setting => 'soft_write_failure',
value => $soft_write_failure,
}
} }