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).
####`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 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
# (defaults to the certname of the current node)
# ['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
# file to configure it to use puppetdb (defaults to true)
# ['manage_storeconfigs'] - If true, the module will manage the puppet master's
@ -60,21 +62,22 @@
# TODO: finish porting this to use params
#
class puppetdb::master::config(
$puppetdb_server = $::fqdn,
$puppetdb_port = 8081,
$manage_routes = true,
$manage_storeconfigs = true,
$manage_report_processor = false,
$manage_config = true,
$strict_validation = true,
$enable_reports = false,
$puppet_confdir = $puppetdb::params::puppet_confdir,
$puppet_conf = $puppetdb::params::puppet_conf,
$puppetdb_version = $puppetdb::params::puppetdb_version,
$terminus_package = $puppetdb::params::terminus_package,
$puppet_service_name = $puppetdb::params::puppet_service_name,
$puppetdb_startup_timeout = $puppetdb::params::puppetdb_startup_timeout,
$restart_puppet = true
$puppetdb_server = $::fqdn,
$puppetdb_port = 8081,
$puppetdb_soft_write_failure = false,
$manage_routes = true,
$manage_storeconfigs = true,
$manage_report_processor = false,
$manage_config = true,
$strict_validation = true,
$enable_reports = false,
$puppet_confdir = $puppetdb::params::puppet_confdir,
$puppet_conf = $puppetdb::params::puppet_conf,
$puppetdb_version = $puppetdb::params::puppetdb_version,
$terminus_package = $puppetdb::params::terminus_package,
$puppet_service_name = $puppetdb::params::puppet_service_name,
$puppetdb_startup_timeout = $puppetdb::params::puppetdb_startup_timeout,
$restart_puppet = true
) inherits puppetdb::params {
package { $terminus_package:
@ -132,10 +135,11 @@ class puppetdb::master::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] },
server => $puppetdb_server,
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] },
}
}

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.
#
# Parameters:
# ['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)
# ['puppet_confdir'] - The config directory of puppet (defaults to /etc/puppet)
# ['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)
# ['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:
# - Configures the required puppetdb settings for the puppet master by managing
@ -16,15 +17,16 @@
#
# Sample Usage:
# class { 'puppetdb::master::puppetdb_conf':
# server => 'my.puppetdb.server'
# server => 'my.puppetdb.server'
# }
#
#
# TODO: finish porting this to use params
#
class puppetdb::master::puppetdb_conf(
$server = 'localhost',
$port = '8081',
class puppetdb::master::puppetdb_conf (
$server = 'localhost',
$port = '8081',
$soft_write_failure = false,
$puppet_confdir = $puppetdb::params::puppet_confdir,
) inherits puppetdb::params {
@ -34,13 +36,18 @@ class puppetdb::master::puppetdb_conf(
path => "${puppet_confdir}/puppetdb.conf",
}
ini_setting {'puppetdbserver':
ini_setting { 'puppetdbserver':
setting => 'server',
value => $server,
}
ini_setting {'puppetdbport':
ini_setting { 'puppetdbport':
setting => 'port',
value => $port,
}
ini_setting { 'soft_write_failure':
setting => 'soft_write_failure',
value => $soft_write_failure,
}
}