Skip to content

Commit f507d3a

Browse files
committed
Updating groups to cover ha scenarios
1 parent 0318550 commit f507d3a

File tree

2 files changed

+79
-35
lines changed

2 files changed

+79
-35
lines changed

manifests/setup/legacy_compiler_group.pp

+39-17
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,63 @@
77
}
88

99
node_group { 'PE Legacy Compiler':
10-
parent => 'PE Master',
11-
rule => ['and',
10+
parent => 'PE Master',
11+
rule => ['and',
1212
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
1313
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
1414
],
15-
classes => {
16-
'pe_repo' => {},
17-
'puppet_enterprise::profile::master' => { 'code_manager_auto_configure' => true, 'replication_mode' => 'none' },
18-
},
19-
data => {
20-
'pe_repo' => { 'compile_master_pool_address' => $primary_host },
21-
},
22-
variables => {
23-
'pe_master' => true,
15+
classes => {
16+
'puppet_enterprise::profile::master' => {
17+
# lint:ignore:single_quote_string_with_variables
18+
'puppetdb_host' => ['${trusted[\'certname\']}'],
19+
# lint:endignore
20+
'puppetdb_port' => [8081],
21+
},
2422
},
2523
}
2624

2725
node_group { 'PE Legacy Compiler Group A':
28-
ensure => 'present',
29-
parent => 'PE Legacy Compiler',
30-
rule => ['and',
26+
ensure => 'present',
27+
parent => 'PE Legacy Compiler',
28+
rule => ['and',
3129
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
3230
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'A'],
3331
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
3432
],
33+
classes => {
34+
'puppet_enterprise::profile::master' => {
35+
'puppetdb_host' => [$internal_compiler_b_pool_address].filter |$_| { $_ },
36+
'puppetdb_port' => [8081],
37+
},
38+
},
39+
data => {
40+
# Workaround for GH-118
41+
'puppet_enterprise::profile::master::puppetdb' => {
42+
'ha_enabled_replicas' => [],
43+
},
44+
},
3545
}
3646

3747
node_group { 'PE Legacy Compiler Group B':
38-
ensure => 'present',
39-
parent => 'PE Legacy Compiler',
40-
rule => ['and',
48+
ensure => 'present',
49+
parent => 'PE Legacy Compiler',
50+
rule => ['and',
4151
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
4252
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'B'],
4353
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
4454
],
55+
classes => {
56+
'puppet_enterprise::profile::master' => {
57+
'puppetdb_host' => [$internal_compiler_b_pool_address].filter |$_| { $_ },
58+
'puppetdb_port' => [8081],
59+
},
60+
},
61+
data => {
62+
# Workaround for GH-118
63+
'puppet_enterprise::profile::master::puppetdb' => {
64+
'ha_enabled_replicas' => [],
65+
},
66+
},
4567
}
4668

4769
node_group { 'PE Compiler':

manifests/setup/node_manager.pp

+40-18
Original file line numberDiff line numberDiff line change
@@ -202,44 +202,66 @@
202202
}
203203

204204
node_group { 'PE Legacy Compiler':
205-
parent => 'PE Master',
206-
rule => ['and',
207-
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
205+
parent => 'PE Master',
206+
rule => ['and',
208207
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
208+
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
209209
],
210-
classes => {
211-
'pe_repo' => {},
212-
'puppet_enterprise::profile::master' => { 'code_manager_auto_configure' => true, 'replication_mode' => 'none' },
213-
},
214-
data => {
215-
'pe_repo' => { 'compile_master_pool_address' => $primary_host },
216-
},
217-
variables => {
218-
'pe_master' => true,
210+
classes => {
211+
'puppet_enterprise::profile::master' => {
212+
# lint:ignore:single_quote_string_with_variables
213+
'puppetdb_host' => ['${trusted[\'certname\']}'],
214+
# lint:endignore
215+
'puppetdb_port' => [8081],
216+
},
219217
},
220218
}
221219

222220
# Configure the A pool for legacy compilers. There are up to two pools for DR, each
223221
# having an affinity for one "availability zone" or the other.
224222
node_group { 'PE Legacy Compiler Group A':
225-
ensure => 'present',
226-
parent => 'PE Legacy Compiler',
227-
rule => ['and',
223+
ensure => 'present',
224+
parent => 'PE Legacy Compiler',
225+
rule => ['and',
228226
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
229227
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'A'],
230228
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
231229
],
230+
classes => {
231+
'puppet_enterprise::profile::master' => {
232+
'puppetdb_host' => [$internal_compiler_b_pool_address].filter |$_| { $_ },
233+
'puppetdb_port' => [8081],
234+
},
235+
},
236+
data => {
237+
# Workaround for GH-118
238+
'puppet_enterprise::profile::master::puppetdb' => {
239+
'ha_enabled_replicas' => [],
240+
},
241+
},
232242
}
233243

234244
# Configure the B pool for legacy compilers. There are up to two pools for DR, each
235245
# having an affinity for one "availability zone" or the other.
236246
node_group { 'PE Legacy Compiler Group B':
237-
ensure => 'present',
238-
parent => 'PE Legacy Compiler',
239-
rule => ['and',
247+
ensure => 'present',
248+
parent => 'PE Legacy Compiler',
249+
rule => ['and',
240250
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'],
241251
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'B'],
242252
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'],
243253
],
254+
classes => {
255+
'puppet_enterprise::profile::master' => {
256+
'puppetdb_host' => [$internal_compiler_b_pool_address].filter |$_| { $_ },
257+
'puppetdb_port' => [8081],
258+
},
259+
},
260+
data => {
261+
# Workaround for GH-118
262+
'puppet_enterprise::profile::master::puppetdb' => {
263+
'ha_enabled_replicas' => [],
264+
},
265+
},
244266
}
245267
}

0 commit comments

Comments
 (0)