diff --git a/manifests/init.pp b/manifests/init.pp index cf73405..44a4e93 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, } diff --git a/manifests/master/config.pp b/manifests/master/config.pp index 3fe770c..815b7d8 100644 --- a/manifests/master/config.pp +++ b/manifests/master/config.pp @@ -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] } } diff --git a/manifests/master/puppetdb_conf.pp b/manifests/master/puppetdb_conf.pp index 9f4a47d..ae06e07 100644 --- a/manifests/master/puppetdb_conf.pp +++ b/manifests/master/puppetdb_conf.pp @@ -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 { diff --git a/manifests/master/routes.pp b/manifests/master/routes.pp index 4f5a7f7..917bca3 100644 --- a/manifests/master/routes.pp +++ b/manifests/master/routes.pp @@ -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; diff --git a/manifests/master/storeconfigs.pp b/manifests/master/storeconfigs.pp index 35ec160..d546c1d 100644 --- a/manifests/master/storeconfigs.pp +++ b/manifests/master/storeconfigs.pp @@ -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{ diff --git a/manifests/params.pp b/manifests/params.pp index f8d8ed2..a412e5f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' } diff --git a/manifests/server.pp b/manifests/server.pp index b0f0ade..ed26e3c 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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] }