Skip to content

Commit 7cf2520

Browse files
bwilcoxreidmv
authored andcommitted
More concise code.
1 parent 248bb5d commit 7cf2520

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

manifests/setup/node_manager.pp

+6-20
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,12 @@
150150
}
151151
}
152152

153-
if ($puppetdb_database_replica_host) {
154-
node_group { 'PE Compiler Group B':
155-
ensure => 'present',
156-
parent => 'PE Master',
157-
rule => ['and',
158-
['=', ['trusted', 'extensions', 'pp_application'], 'puppet/compiler'],
159-
['=', ['trusted', 'extensions', 'pp_cluster'], 'B'],
160-
],
161-
classes => {
162-
'puppet_enterprise::profile::puppetdb' => {
163-
'database_host' => $puppetdb_database_replica_host,
164-
},
165-
'puppet_enterprise::profile::master' => {
166-
'puppetdb_host' => ['${clientcert}', $master_host], # lint:ignore:single_quote_string_with_variables
167-
'puppetdb_port' => [8081],
168-
}
169-
},
170-
data => $compiler_data,
153+
if ($puppetdb_database_replica_host) or ($master_replica_host) {
154+
if ($puppetdb_database_replica_host) {
155+
$dbhost = $puppetdb_database_replica_host
156+
} else {
157+
$dbhost = $puppetdb_database_host
171158
}
172-
} elsif ($master_replica_host) {
173159
node_group { 'PE Compiler Group B':
174160
ensure => 'present',
175161
parent => 'PE Master',
@@ -179,7 +165,7 @@
179165
],
180166
classes => {
181167
'puppet_enterprise::profile::puppetdb' => {
182-
'database_host' => $puppetdb_database_host,
168+
'database_host' => $dbhost,
183169
},
184170
'puppet_enterprise::profile::master' => {
185171
'puppetdb_host' => ['${clientcert}', $master_host], # lint:ignore:single_quote_string_with_variables

0 commit comments

Comments
 (0)