module-puppetdb/manifests/master/routes.pp
Chris Price 8fbda3c4d6 Use ini_file to manage settings, and add validation
This commit does the following:

* Use the new inifile module to manage puppet.conf
* More comprehensive management of config files
* Validate database connectivity before applying puppetdb
  config changes
* Validate puppetdb connectivity before applying puppet
  master config changes
* Documentation
2012-09-17 15:26:32 -07:00

37 lines
1.2 KiB
Puppet

# Class: puppetdb::master::routes
#
# This class configures the puppet master to use puppetdb as the facts terminus.
#
# WARNING: the current implementation simply overwrites your routes.yaml file;
# if you have an existing routes.yaml file that you are using for other purposes,
# you should *not* use this.
#
# Parameters:
# ['puppet_confdir'] - The puppet config directory (defaults to /etc/puppet)
#
# Actions:
# - Configures the puppet master to use puppetdb as a facts terminus by
# overwriting routes.yaml
#
# Sample Usage:
# class { 'puppetdb::master::routes':
# puppet_confdir => '/etc/puppet'
# }
#
# TODO: port this to use params
class puppetdb::master::routes(
$puppet_confdir = '/etc/puppet',
)
{
# TODO: this will overwrite any existing routes.yaml;
# to handle this properly we should just be ensuring
# that the proper settings exist, but to do that we'd need
# to parse the yaml file and rewrite it, dealing with indentation issues etc.
# I don't think there is currently a puppet module or an augeas lens for this.
file { "${puppet_confdir}/routes.yaml":
ensure => file,
source => 'puppet:///modules/puppetdb/routes.yaml',
}
}