-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PE-39577) Optimise legacy compiler support
This commit: - Adds the `node_group_unpin` task. - `node_group_unpin` task is called in the convert plan to remove legacy compilers from from the PE Master node group. - Legacy compilers `pp_auth_role` changed to `legacy_compiler`. - Changes the PEADM config to use the PE Certificate Authority node group. - Removes peadm_legacy_compiler extension.
- Loading branch information
petergmurphy
committed
Jan 30, 2025
1 parent
26c3ddf
commit 9b36382
Showing
12 changed files
with
198 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,71 @@ | ||
# @api private | ||
class peadm::setup::legacy_compiler_group ( | ||
String[1] $primary_host, | ||
Optional[String] $internal_compiler_a_pool_address = undef, | ||
Optional[String] $internal_compiler_b_pool_address = undef, | ||
Optional[String] $internal_compiler_a_pool_address = undef, | ||
Optional[String] $internal_compiler_b_pool_address = undef, | ||
) { | ||
Node_group { | ||
purge_behavior => none, | ||
} | ||
|
||
node_group { 'PE Legacy Compiler': | ||
parent => 'PE Master', | ||
rule => ['and', | ||
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'], | ||
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'], | ||
], | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
'puppetdb_host' => [$internal_compiler_a_pool_address, $internal_compiler_b_pool_address].filter |$_| { $_ }, | ||
'puppetdb_port' => [8081], | ||
ensure => 'present', | ||
parent => 'PE Master', | ||
purge_behavior => 'classes', | ||
rule => ['=', ['trusted', 'extensions', 'pp_auth_role'], 'legacy_compiler'], | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
'puppetdb_host' => [$internal_compiler_a_pool_address, $internal_compiler_b_pool_address].filter |$_| { $_ }, | ||
'puppetdb_port' => [8081], | ||
'replication_mode' => 'none', | ||
'code_manager_auto_configure' => true, | ||
}, | ||
}, | ||
} | ||
|
||
node_group { 'PE Legacy Compiler Group A': | ||
ensure => 'present', | ||
parent => 'PE Legacy Compiler', | ||
rule => ['and', | ||
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'], | ||
ensure => 'present', | ||
parent => 'PE Legacy Compiler', | ||
purge_behavior => 'classes', | ||
rule => ['and', | ||
['=', ['trusted', 'extensions', 'pp_auth_role'], 'legacy_compiler'], | ||
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'A'], | ||
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'], | ||
], | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
'puppetdb_host' => [$internal_compiler_b_pool_address, $internal_compiler_a_pool_address].filter |$_| { $_ }, | ||
'puppetdb_port' => [8081], | ||
}, | ||
}, | ||
data => { | ||
# Workaround for GH-118 | ||
data => { | ||
'puppet_enterprise::profile::master::puppetdb' => { | ||
'ha_enabled_replicas' => [], | ||
}, | ||
}, | ||
} | ||
|
||
node_group { 'PE Legacy Compiler Group B': | ||
ensure => 'present', | ||
parent => 'PE Legacy Compiler', | ||
rule => ['and', | ||
['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'], | ||
ensure => 'present', | ||
parent => 'PE Legacy Compiler', | ||
purge_behavior => 'classes', | ||
rule => ['and', | ||
['=', ['trusted', 'extensions', 'pp_auth_role'], 'legacy_compiler'], | ||
['=', ['trusted', 'extensions', peadm::oid('peadm_availability_group')], 'B'], | ||
['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'true'], | ||
], | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
classes => { | ||
'puppet_enterprise::profile::master' => { | ||
'puppetdb_host' => [$internal_compiler_a_pool_address, $internal_compiler_b_pool_address].filter |$_| { $_ }, | ||
'puppetdb_port' => [8081], | ||
}, | ||
}, | ||
data => { | ||
# Workaround for GH-118 | ||
data => { | ||
'puppet_enterprise::profile::master::puppetdb' => { | ||
'ha_enabled_replicas' => [], | ||
}, | ||
}, | ||
} | ||
|
||
node_group { 'PE Compiler': | ||
rule => ['and', ['=', ['trusted', 'extensions', peadm::oid('peadm_legacy_compiler')], 'false']], | ||
rule => ['=', ['trusted', 'extensions', 'pp_auth_role'], 'pe_compiler'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
end | ||
|
||
let(:params) do | ||
{ 'primary_host' => 'primary' } | ||
{ 'primary_host' => 'primary', 'legacy_compilers' => 'legacy_compiler' } | ||
end | ||
|
||
it 'single primary no dr valid' do | ||
Check failure on line 15 in spec/plans/convert_spec.rb GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)
Check failure on line 15 in spec/plans/convert_spec.rb GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)
|
||
|
@@ -21,6 +21,7 @@ | |
expect_task('peadm::cert_data').return_for_targets('primary' => trustedjson) | ||
expect_task('peadm::read_file').always_return({ 'content' => '2021.7.9' }) | ||
expect_task('peadm::get_group_rules').return_for_targets('primary' => { '_output' => '{"rules": []}' }) | ||
expect_task('peadm::node_group_unpin').with_targets('primary').with_params({ 'node_certname' => 'legacy_compiler', 'group_name' => 'PE Master' }) | ||
|
||
# For some reason, expect_plan() was not working?? | ||
allow_plan('peadm::modify_certificate').always_return({}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.