(PDB-2696) Remove the dependency cycle cause by typo

This commit removes the dependency cycle caused by a typo in the config
name for config.ini and properly threads through the vardir setting to
the puppetdb::server::global class.
This commit is contained in:
Andrew Roetker 2016-05-13 12:23:49 -07:00
parent 6b26a28d22
commit 867e9fe22e
11 changed files with 51 additions and 33 deletions

View file

@ -513,6 +513,10 @@ service doesn't start on boot either. Valid values are `true`, `running`,
The PuppetDB configuration directory. Defaults to `/etc/puppetdb/conf.d`. The PuppetDB configuration directory. Defaults to `/etc/puppetdb/conf.d`.
####`vardir`
The parent directory for the MQ's data directory.
####`java_args` ####`java_args`
Java VM options used for overriding default Java VM options specified in Java VM options used for overriding default Java VM options specified in

View file

@ -60,6 +60,7 @@ class puppetdb (
$read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive, $read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive,
$read_conn_lifetime = $puppetdb::params::read_conn_lifetime, $read_conn_lifetime = $puppetdb::params::read_conn_lifetime,
$confdir = $puppetdb::params::confdir, $confdir = $puppetdb::params::confdir,
$vardir = $puppetdb::params::vardir,
$manage_firewall = $puppetdb::params::manage_firewall, $manage_firewall = $puppetdb::params::manage_firewall,
$java_args = $puppetdb::params::java_args, $java_args = $puppetdb::params::java_args,
$merge_default_java_args = $puppetdb::params::merge_default_java_args, $merge_default_java_args = $puppetdb::params::merge_default_java_args,
@ -112,6 +113,7 @@ class puppetdb (
puppetdb_service => $puppetdb_service, puppetdb_service => $puppetdb_service,
puppetdb_service_status => $puppetdb_service_status, puppetdb_service_status => $puppetdb_service_status,
confdir => $confdir, confdir => $confdir,
vardir => $vardir,
java_args => $java_args, java_args => $java_args,
merge_default_java_args => $merge_default_java_args, merge_default_java_args => $merge_default_java_args,
max_threads => $max_threads, max_threads => $max_threads,

View file

@ -55,6 +55,7 @@ class puppetdb::server (
$read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive, $read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive,
$read_conn_lifetime = $puppetdb::params::read_conn_lifetime, $read_conn_lifetime = $puppetdb::params::read_conn_lifetime,
$confdir = $puppetdb::params::confdir, $confdir = $puppetdb::params::confdir,
$vardir = $puppetdb::params::vardir,
$manage_firewall = $puppetdb::params::manage_firewall, $manage_firewall = $puppetdb::params::manage_firewall,
$java_args = $puppetdb::params::java_args, $java_args = $puppetdb::params::java_args,
$merge_default_java_args = $puppetdb::params::merge_default_java_args, $merge_default_java_args = $puppetdb::params::merge_default_java_args,
@ -298,6 +299,7 @@ class puppetdb::server (
if $manage_firewall { if $manage_firewall {
Package[$puppetdb_package] -> Package[$puppetdb_package] ->
Class['puppetdb::server::firewall'] -> Class['puppetdb::server::firewall'] ->
Class['puppetdb::server::global'] ->
Class['puppetdb::server::command_processing'] -> Class['puppetdb::server::command_processing'] ->
Class['puppetdb::server::database'] -> Class['puppetdb::server::database'] ->
Class['puppetdb::server::read_database'] -> Class['puppetdb::server::read_database'] ->
@ -306,6 +308,7 @@ class puppetdb::server (
Service[$puppetdb_service] Service[$puppetdb_service]
} else { } else {
Package[$puppetdb_package] -> Package[$puppetdb_package] ->
Class['puppetdb::server::global'] ->
Class['puppetdb::server::command_processing'] -> Class['puppetdb::server::command_processing'] ->
Class['puppetdb::server::database'] -> Class['puppetdb::server::database'] ->
Class['puppetdb::server::read_database'] -> Class['puppetdb::server::read_database'] ->

View file

@ -6,12 +6,14 @@ class puppetdb::server::command_processing (
$confdir = $puppetdb::params::confdir, $confdir = $puppetdb::params::confdir,
) inherits puppetdb::params { ) inherits puppetdb::params {
$config_ini = "${confdir}/config.ini"
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/config.ini", path => $config_ini,
ensure => 'present', ensure => 'present',
section => 'command-processing', section => 'command-processing',
require => File["${confdir}/config.ini"], require => File[$config_ini],
} }
if $command_threads { if $command_threads {

View file

@ -42,21 +42,23 @@ class puppetdb::server::database (
} }
} }
file { "${confdir}/database.ini": $database_ini = "${confdir}/database.ini"
file { $database_ini:
ensure => file, ensure => file,
owner => $puppetdb_user, owner => $puppetdb_user,
group => $puppetdb_group, group => $puppetdb_group,
mode => '0600', mode => '0600',
} }
$file_require = File["${confdir}/database.ini"] $file_require = File[$database_ini]
$ini_setting_require = str2bool($database_validate) ? { $ini_setting_require = str2bool($database_validate) ? {
false => $file_require, false => $file_require,
default => [$file_require, Class['puppetdb::server::validate_db']], default => [$file_require, Class['puppetdb::server::validate_db']],
} }
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/database.ini", path => $database_ini,
ensure => present, ensure => present,
section => 'database', section => 'database',
require => $ini_setting_require require => $ini_setting_require

View file

@ -6,19 +6,21 @@ class puppetdb::server::global (
$puppetdb_group = $puppetdb::params::puppetdb_group, $puppetdb_group = $puppetdb::params::puppetdb_group,
) inherits puppetdb::params { ) inherits puppetdb::params {
file { "${confdir}/config.ini": $config_ini = "${confdir}/config.ini"
file { $config_ini:
ensure => file, ensure => file,
owner => $puppetdb_user, owner => $puppetdb_user,
group => $puppetdb_group, group => $puppetdb_group,
mode => '0600', mode => '0600',
} }
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/config.ini", path => $config_ini,
ensure => 'present', ensure => 'present',
section => 'global', section => 'global',
require => File["${confdir}/config.ini"], require => File[$config_ini],
} }
if $vardir { if $vardir {

View file

@ -17,19 +17,21 @@ class puppetdb::server::jetty (
$puppetdb_group = $puppetdb::params::puppetdb_group, $puppetdb_group = $puppetdb::params::puppetdb_group,
) inherits puppetdb::params { ) inherits puppetdb::params {
file { "${confdir}/jetty.ini": $jetty_ini = "${confdir}/jetty.ini"
file { $jetty_ini:
ensure => file, ensure => file,
owner => $puppetdb_user, owner => $puppetdb_user,
group => $puppetdb_group, group => $puppetdb_group,
mode => '0600', mode => '0600',
} }
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/jetty.ini", path => $jetty_ini,
ensure => present, ensure => present,
section => 'jetty', section => 'jetty',
require => File["${confdir}/puppetdb.ini"], require => File[$jetty_ini],
} }
$cleartext_setting_ensure = $disable_cleartext ? { $cleartext_setting_ensure = $disable_cleartext ? {

View file

@ -7,19 +7,21 @@ class puppetdb::server::puppetdb (
$puppetdb_group = $puppetdb::params::puppetdb_group, $puppetdb_group = $puppetdb::params::puppetdb_group,
) inherits puppetdb::params { ) inherits puppetdb::params {
file { "${confdir}/puppetdb.ini": $puppetdb_ini = "${confdir}/puppetdb.ini"
file { $puppetdb_ini:
ensure => file, ensure => file,
owner => $puppetdb_user, owner => $puppetdb_user,
group => $puppetdb_group, group => $puppetdb_group,
mode => '0600', mode => '0600',
} }
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/puppetdb.ini", path => $puppetdb_ini,
ensure => present, ensure => present,
section => 'puppetdb', section => 'puppetdb',
require => File["${confdir}/puppetdb.ini"], require => File[$puppetdb_ini],
} }
$certificate_whitelist_setting_ensure = empty($certificate_whitelist) ? { $certificate_whitelist_setting_ensure = empty($certificate_whitelist) ? {
@ -30,7 +32,6 @@ class puppetdb::server::puppetdb (
# accept connections only from puppet master # accept connections only from puppet master
ini_setting {'puppetdb-connections-from-master-only': ini_setting {'puppetdb-connections-from-master-only':
ensure => $certificate_whitelist_setting_ensure, ensure => $certificate_whitelist_setting_ensure,
path => "${confdir}/puppetdb.ini",
section => 'puppetdb', section => 'puppetdb',
setting => 'certificate-whitelist', setting => 'certificate-whitelist',
value => $certificate_whitelist_file, value => $certificate_whitelist_file,

View file

@ -39,21 +39,23 @@ class puppetdb::server::read_database (
} }
} }
file { "${confdir}/read_database.ini": $read_database_ini = "${confdir}/read_database.ini"
file { $read_database_ini:
ensure => file, ensure => file,
owner => $puppetdb_user, owner => $puppetdb_user,
group => $puppetdb_group, group => $puppetdb_group,
mode => '0600', mode => '0600',
} }
$file_require = File["${confdir}/read_database.ini"] $file_require = File[$read_database_ini]
$ini_setting_require = str2bool($database_validate) ? { $ini_setting_require = str2bool($database_validate) ? {
false => $file_require, false => $file_require,
default => [$file_require, Class['puppetdb::server::validate_read_db']], default => [$file_require, Class['puppetdb::server::validate_read_db']],
} }
# Set the defaults # Set the defaults
Ini_setting { Ini_setting {
path => "${confdir}/read_database.ini", path => $read_database_ini,
ensure => present, ensure => present,
section => 'read-database', section => 'read-database',
require => $ini_setting_require, require => $ini_setting_require,

View file

@ -1,6 +1,6 @@
{ {
"name": "puppetlabs-puppetdb", "name": "puppetlabs-puppetdb",
"version": "5.1.2", "version": "5.2.0",
"summary": "Installs PostgreSQL and PuppetDB, sets up the connection to Puppet master.", "summary": "Installs PostgreSQL and PuppetDB, sets up the connection to Puppet master.",
"source": "git://github.com/puppetlabs/puppetlabs-puppetdb.git", "source": "git://github.com/puppetlabs/puppetlabs-puppetdb.git",
"project_page": "http://github.com/puppetlabs/puppetlabs-puppetdb", "project_page": "http://github.com/puppetlabs/puppetlabs-puppetdb",

View file

@ -15,7 +15,6 @@ describe 'puppetdb::server::global', :type => :class do
it { should contain_ini_setting('puppetdb_global_vardir'). it { should contain_ini_setting('puppetdb_global_vardir').
with( with(
'ensure' => 'present', 'ensure' => 'present',
'path' => 'opt/puppetlabs/server/data/puppetdb',
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini', 'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
'section' => 'global', 'section' => 'global',
'setting' => 'vardir', 'setting' => 'vardir',
@ -35,7 +34,6 @@ describe 'puppetdb::server::global', :type => :class do
it {should contain_ini_setting('puppetdb_global_vardir'). it {should contain_ini_setting('puppetdb_global_vardir').
with( with(
'ensure' => 'present', 'ensure' => 'present',
'path' => 'opt/puppetlabs/server/data/puppetdb',
'path' => '/etc/puppetdb/conf.d/config.ini', 'path' => '/etc/puppetdb/conf.d/config.ini',
'section' => 'global', 'section' => 'global',
'setting' => 'vardir', 'setting' => 'vardir',