Skip to content

Commit fee74d7

Browse files
author
Andrew Roetker
committed
(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.
1 parent 6b26a28 commit fee74d7

11 files changed

Lines changed: 51 additions & 33 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ service doesn't start on boot either. Valid values are `true`, `running`,
513513

514514
The PuppetDB configuration directory. Defaults to `/etc/puppetdb/conf.d`.
515515

516+
####`vardir`
517+
518+
The parent directory for the MQ's data directory.
519+
516520
####`java_args`
517521

518522
Java VM options used for overriding default Java VM options specified in

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
$read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive,
6161
$read_conn_lifetime = $puppetdb::params::read_conn_lifetime,
6262
$confdir = $puppetdb::params::confdir,
63+
$vardir = $puppetdb::params::vardir,
6364
$manage_firewall = $puppetdb::params::manage_firewall,
6465
$java_args = $puppetdb::params::java_args,
6566
$merge_default_java_args = $puppetdb::params::merge_default_java_args,
@@ -112,6 +113,7 @@
112113
puppetdb_service => $puppetdb_service,
113114
puppetdb_service_status => $puppetdb_service_status,
114115
confdir => $confdir,
116+
vardir => $vardir,
115117
java_args => $java_args,
116118
merge_default_java_args => $merge_default_java_args,
117119
max_threads => $max_threads,

manifests/server.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
$read_conn_keep_alive = $puppetdb::params::read_conn_keep_alive,
5656
$read_conn_lifetime = $puppetdb::params::read_conn_lifetime,
5757
$confdir = $puppetdb::params::confdir,
58+
$vardir = $puppetdb::params::vardir,
5859
$manage_firewall = $puppetdb::params::manage_firewall,
5960
$java_args = $puppetdb::params::java_args,
6061
$merge_default_java_args = $puppetdb::params::merge_default_java_args,
@@ -298,6 +299,7 @@
298299
if $manage_firewall {
299300
Package[$puppetdb_package] ->
300301
Class['puppetdb::server::firewall'] ->
302+
Class['puppetdb::server::global'] ->
301303
Class['puppetdb::server::command_processing'] ->
302304
Class['puppetdb::server::database'] ->
303305
Class['puppetdb::server::read_database'] ->
@@ -306,6 +308,7 @@
306308
Service[$puppetdb_service]
307309
} else {
308310
Package[$puppetdb_package] ->
311+
Class['puppetdb::server::global'] ->
309312
Class['puppetdb::server::command_processing'] ->
310313
Class['puppetdb::server::database'] ->
311314
Class['puppetdb::server::read_database'] ->

manifests/server/command_processing.pp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
$confdir = $puppetdb::params::confdir,
77
) inherits puppetdb::params {
88

9+
$config_ini = "${confdir}/config.ini"
10+
911
# Set the defaults
1012
Ini_setting {
11-
path => "${confdir}/config.ini",
13+
path => $config_ini,
1214
ensure => 'present',
1315
section => 'command-processing',
14-
require => File["${confdir}/config.ini"],
16+
require => File[$config_ini],
1517
}
1618

1719
if $command_threads {

manifests/server/database.pp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,23 @@
4242
}
4343
}
4444

45-
file { "${confdir}/database.ini":
45+
$database_ini = "${confdir}/database_ini"
46+
47+
file { $database_ini:
4648
ensure => file,
47-
owner => $puppetdb_user,
48-
group => $puppetdb_group,
49-
mode => '0600',
49+
owner => $puppetdb_user,
50+
group => $puppetdb_group,
51+
mode => '0600',
5052
}
5153

52-
$file_require = File["${confdir}/database.ini"]
54+
$file_require = File[$database_ini]
5355
$ini_setting_require = str2bool($database_validate) ? {
5456
false => $file_require,
5557
default => [$file_require, Class['puppetdb::server::validate_db']],
5658
}
5759
# Set the defaults
5860
Ini_setting {
59-
path => "${confdir}/database.ini",
61+
path => $database_ini,
6062
ensure => present,
6163
section => 'database',
6264
require => $ini_setting_require

manifests/server/global.pp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
$puppetdb_group = $puppetdb::params::puppetdb_group,
77
) inherits puppetdb::params {
88

9-
file { "${confdir}/config.ini":
9+
$config_ini = "${confdir}/config.ini"
10+
11+
file { $config_ini:
1012
ensure => file,
11-
owner => $puppetdb_user,
12-
group => $puppetdb_group,
13-
mode => '0600',
13+
owner => $puppetdb_user,
14+
group => $puppetdb_group,
15+
mode => '0600',
1416
}
1517

1618
# Set the defaults
1719
Ini_setting {
18-
path => "${confdir}/config.ini",
20+
path => $config_ini,
1921
ensure => 'present',
2022
section => 'global',
21-
require => File["${confdir}/config.ini"],
23+
require => File[$config_ini],
2224
}
2325

2426
if $vardir {

manifests/server/jetty.pp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717
$puppetdb_group = $puppetdb::params::puppetdb_group,
1818
) inherits puppetdb::params {
1919

20-
file { "${confdir}/jetty.ini":
20+
$jetty_ini = "${confdir}/jetty.ini"
21+
22+
file { $jetty_ini:
2123
ensure => file,
22-
owner => $puppetdb_user,
23-
group => $puppetdb_group,
24-
mode => '0600',
24+
owner => $puppetdb_user,
25+
group => $puppetdb_group,
26+
mode => '0600',
2527
}
2628

2729
# Set the defaults
2830
Ini_setting {
29-
path => "${confdir}/jetty.ini",
31+
path => $jetty_ini,
3032
ensure => present,
3133
section => 'jetty',
32-
require => File["${confdir}/puppetdb.ini"],
34+
require => File[$jetty_ini],
3335
}
3436

3537
$cleartext_setting_ensure = $disable_cleartext ? {

manifests/server/puppetdb.pp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
$puppetdb_group = $puppetdb::params::puppetdb_group,
88
) inherits puppetdb::params {
99

10-
file { "${confdir}/puppetdb.ini":
10+
$puppetdb_ini = "${confdir}/puppetdb.ini"
11+
12+
file { $puppetdb_ini:
1113
ensure => file,
12-
owner => $puppetdb_user,
13-
group => $puppetdb_group,
14-
mode => '0600',
14+
owner => $puppetdb_user,
15+
group => $puppetdb_group,
16+
mode => '0600',
1517
}
1618

1719
# Set the defaults
1820
Ini_setting {
19-
path => "${confdir}/puppetdb.ini",
21+
path => $puppetdb_ini,
2022
ensure => present,
2123
section => 'puppetdb',
22-
require => File["${confdir}/puppetdb.ini"],
24+
require => File[$puppetdb_ini],
2325
}
2426

2527
$certificate_whitelist_setting_ensure = empty($certificate_whitelist) ? {
@@ -30,7 +32,6 @@
3032
# accept connections only from puppet master
3133
ini_setting {'puppetdb-connections-from-master-only':
3234
ensure => $certificate_whitelist_setting_ensure,
33-
path => "${confdir}/puppetdb.ini",
3435
section => 'puppetdb',
3536
setting => 'certificate-whitelist',
3637
value => $certificate_whitelist_file,

manifests/server/read_database.pp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,23 @@
3939
}
4040
}
4141

42-
file { "${confdir}/read_database.ini":
42+
$read_database_ini = "${confdir}/read_database_ini"
43+
44+
file { $read_database_ini:
4345
ensure => file,
4446
owner => $puppetdb_user,
4547
group => $puppetdb_group,
4648
mode => '0600',
4749
}
4850

49-
$file_require = File["${confdir}/read_database.ini"]
51+
$file_require = File[$read_database_ini]
5052
$ini_setting_require = str2bool($database_validate) ? {
5153
false => $file_require,
5254
default => [$file_require, Class['puppetdb::server::validate_read_db']],
5355
}
5456
# Set the defaults
5557
Ini_setting {
56-
path => "${confdir}/read_database.ini",
58+
path => $read_database_ini,
5759
ensure => present,
5860
section => 'read-database',
5961
require => $ini_setting_require,

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-puppetdb",
3-
"version": "5.1.2",
3+
"version": "5.2.0",
44
"summary": "Installs PostgreSQL and PuppetDB, sets up the connection to Puppet master.",
55
"source": "git://github.com/puppetlabs/puppetlabs-puppetdb.git",
66
"project_page": "http://github.com/puppetlabs/puppetlabs-puppetdb",

0 commit comments

Comments
 (0)