diff --git a/README.md b/README.md index 8641692..8db27c7 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/manifests/master/config.pp b/manifests/master/config.pp index 9d20304..b8f60cc 100644 --- a/manifests/master/config.pp +++ b/manifests/master/config.pp @@ -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] }, } } diff --git a/manifests/master/puppetdb_conf.pp b/manifests/master/puppetdb_conf.pp index abe4e15..6f7a71c 100644 --- a/manifests/master/puppetdb_conf.pp +++ b/manifests/master/puppetdb_conf.pp @@ -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, + } }