Add parameters to enable usage of enterprise versions of PuppetDB
This commit is contained in:
parent
5f48dabd7a
commit
df6f7cc345
7 changed files with 35 additions and 20 deletions
|
@ -39,13 +39,19 @@
|
|||
#
|
||||
class puppetdb(
|
||||
$database = $puppetdb::params::database,
|
||||
$puppetdb_package = $puppetdb::params::puppetdb_package,
|
||||
$puppetdb_version = $puppetdb::params::puppetdb_version,
|
||||
$puppetdb_service = $puppetdb::params::puppetdb_service,
|
||||
$confdir = $puppetdb::params::confdir,
|
||||
$manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
|
||||
) inherits puppetdb::params {
|
||||
|
||||
class { 'puppetdb::server':
|
||||
database => $database,
|
||||
puppetdb_package => $puppetdb_package,
|
||||
puppetdb_version => $puppetdb_version,
|
||||
puppetdb_service => $puppetdb_service,
|
||||
confdir => $confdir,
|
||||
manage_redhat_firewall => $manage_redhat_firewall,
|
||||
}
|
||||
|
||||
|
|
|
@ -47,14 +47,16 @@ class puppetdb::master::config(
|
|||
$puppetdb_port = 8081,
|
||||
$manage_routes = true,
|
||||
$manage_storeconfigs = true,
|
||||
$puppet_confdir = '/etc/puppet',
|
||||
$puppet_conf = '/etc/puppet/puppet.conf',
|
||||
$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,
|
||||
$restart_puppet = true,
|
||||
) inherits puppetdb::params {
|
||||
|
||||
package { 'puppetdb-terminus':
|
||||
ensure => $puppetdb_version,
|
||||
package { $terminus_package:
|
||||
ensure => $puppetdb_version,
|
||||
}
|
||||
|
||||
# Validate the puppetdb connection. If we can't connect to puppetdb then we
|
||||
|
@ -62,7 +64,7 @@ class puppetdb::master::config(
|
|||
puppetdb_conn_validator { 'puppetdb_conn':
|
||||
puppetdb_server => $puppetdb_server,
|
||||
puppetdb_port => $puppetdb_port,
|
||||
require => Package['puppetdb-terminus'],
|
||||
require => Package[$terminus_package],
|
||||
}
|
||||
|
||||
# This is a bit of puppet chicanery that allows us to create a
|
||||
|
@ -102,14 +104,14 @@ class puppetdb::master::config(
|
|||
if ($restart_puppet) {
|
||||
# We will need to restart the puppet master service if certain config
|
||||
# files are changed, so here we make sure it's in the catalog.
|
||||
if ! defined(Service[$puppetdb::params::puppet_service_name]) {
|
||||
service { $puppetdb::params::puppet_service_name:
|
||||
if ! defined(Service[$puppet_service_name]) {
|
||||
service { $puppet_service_name:
|
||||
ensure => running,
|
||||
}
|
||||
}
|
||||
|
||||
Class['puppetdb::master::puppetdb_conf'] ~> Service[$puppetdb::params::puppet_service_name]
|
||||
Class['puppetdb::master::routes'] ~> Service[$puppetdb::params::puppet_service_name]
|
||||
Class['puppetdb::master::puppetdb_conf'] ~> Service[$puppet_service_name]
|
||||
Class['puppetdb::master::routes'] ~> Service[$puppet_service_name]
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
class puppetdb::master::puppetdb_conf(
|
||||
$server = 'localhost',
|
||||
$port = '8081',
|
||||
$puppet_confdir = '/etc/puppet',
|
||||
$puppet_confdir = $puppetdb::params::puppet_confdir,
|
||||
) {
|
||||
|
||||
Ini_setting {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# TODO: port this to use params
|
||||
#
|
||||
class puppetdb::master::routes(
|
||||
$puppet_confdir = '/etc/puppet',
|
||||
$puppet_confdir = $puppetdb::params::puppet_confdir,
|
||||
) {
|
||||
|
||||
# TODO: this will overwrite any existing routes.yaml;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# TODO: port this to use params
|
||||
#
|
||||
class puppetdb::master::storeconfigs(
|
||||
$puppet_conf = '/etc/puppet/puppet.conf',
|
||||
$puppet_conf = $puppetdb::params::puppet_conf
|
||||
) {
|
||||
|
||||
Ini_setting{
|
||||
|
|
|
@ -31,7 +31,6 @@ class puppetdb::params {
|
|||
$manage_redhat_firewall = true
|
||||
|
||||
$gc_interval = '60'
|
||||
$confdir = '/etc/puppetdb/conf.d'
|
||||
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
|
@ -50,5 +49,11 @@ class puppetdb::params {
|
|||
}
|
||||
|
||||
# TODO: need to condition this for PE
|
||||
$puppetdb_package = 'puppetdb'
|
||||
$puppetdb_service = 'puppetdb'
|
||||
$confdir = '/etc/puppetdb/conf.d'
|
||||
$puppet_service_name = 'puppetmaster'
|
||||
$puppet_confdir = '/etc/puppet'
|
||||
$puppet_conf = "${puppet_confdir}/puppet.conf"
|
||||
$terminus_package = 'puppetdb-terminus'
|
||||
}
|
||||
|
|
|
@ -76,15 +76,17 @@ class puppetdb::server(
|
|||
$database_username = $puppetdb::params::database_username,
|
||||
$database_password = $puppetdb::params::database_password,
|
||||
$database_name = $puppetdb::params::database_name,
|
||||
$puppetdb_package = $puppetdb::params::puppetdb_package,
|
||||
$puppetdb_version = $puppetdb::params::puppetdb_version,
|
||||
$puppetdb_service = $puppetdb::params::puppetdb_service,
|
||||
$manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
|
||||
$confdir = $puppetdb::params::confdir,
|
||||
$gc_interval = $puppetdb::params::gc_interval,
|
||||
) inherits puppetdb::params {
|
||||
|
||||
package { 'puppetdb':
|
||||
package { $puppetdb_package:
|
||||
ensure => $puppetdb_version,
|
||||
notify => Service['puppetdb'],
|
||||
notify => Service[$puppetdb_service],
|
||||
}
|
||||
|
||||
class { 'puppetdb::server::firewall':
|
||||
|
@ -100,24 +102,24 @@ class puppetdb::server(
|
|||
database_password => $database_password,
|
||||
database_name => $database_name,
|
||||
confdir => $confdir,
|
||||
notify => Service['puppetdb'],
|
||||
notify => Service[$puppetdb_service],
|
||||
}
|
||||
|
||||
class { 'puppetdb::server::jetty_ini':
|
||||
ssl_listen_address => $ssl_listen_address,
|
||||
ssl_listen_port => $ssl_listen_port,
|
||||
confdir => $confdir,
|
||||
notify => Service['puppetdb'],
|
||||
notify => Service[$puppetdb_service],
|
||||
}
|
||||
|
||||
service { 'puppetdb':
|
||||
service { $puppetdb_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
}
|
||||
|
||||
Package['puppetdb'] ->
|
||||
Package[$puppetdb_package] ->
|
||||
Class['puppetdb::server::firewall'] ->
|
||||
Class['puppetdb::server::database_ini'] ->
|
||||
Class['puppetdb::server::jetty_ini'] ->
|
||||
Service['puppetdb']
|
||||
Service[$puppetdb_service]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue