Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plans/add_compilers.pp
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,8 @@
]))

$compiler_names = $compiler_targets.map |$compiler_target| { $compiler_target.peadm::certname() }.join(', ')

out::message('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')

return("Adding or replacing compiler(s) ${compiler_names} succeeded.")
}
10 changes: 9 additions & 1 deletion spec/plans/add_compilers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def allow_standard_non_returning_calls

it 'runs successfully when no alt-names are specified' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')

expect_task('peadm::get_peadm_config').always_return(cfg)
expect_task('peadm::check_pe_master_rules').always_return(pe_rule_check)
Expand All @@ -65,11 +66,14 @@ def allow_standard_non_returning_calls
expect_plan('peadm::util::copy_file').be_called_times(1)
expect_task('peadm::puppet_runonce').with_targets(['compiler'])
expect_task('peadm::puppet_runonce').with_targets(['server_a'])
expect(run_plan('peadm::add_compilers', params)).to be_ok
result = run_plan('peadm::add_compilers', params)
expect(result).to be_ok
expect(result.value).to eq('Adding or replacing compiler(s) compiler succeeded.')
end

it 'handles different avail_group_letter values' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')
cfg['role-letter']['server']['B'] = 'server_b'

expect_task('peadm::get_peadm_config').always_return(cfg)
Expand All @@ -86,6 +90,7 @@ def allow_standard_non_returning_calls

it 'handles specified primary_postgresql_host' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')

expect_task('peadm::get_peadm_config').always_return(cfg)
expect_task('peadm::check_pe_master_rules').always_return(pe_rule_check)
Expand All @@ -100,6 +105,7 @@ def allow_standard_non_returning_calls

it 'handles external postgresql host group A' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')
cfg['params']['primary_postgresql_host'] = 'external_postgresql'
cfg['params']['replica_postgresql_host'] = 'external_postgresql'

Expand All @@ -116,6 +122,7 @@ def allow_standard_non_returning_calls

it 'handles external postgresql host group A with replica' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')
cfg['params']['primary_postgresql_host'] = 'external_postgresql'
cfg['role-letter']['server']['B'] = 'replica'

Expand All @@ -133,6 +140,7 @@ def allow_standard_non_returning_calls

it 'handles external postgresql host group B' do
allow_standard_non_returning_calls
expect_out_message.with_params('Compilers are added in CA-proxy mode. Promotion to an Intermediate CA is opt-in and performed separately.')
cfg['params']['replica_postgresql_host'] = 'replica_external_postgresql'

expect_task('peadm::get_peadm_config').always_return(cfg)
Expand Down
Loading