From a9deefef8a33d361c771eaed300379ba8e4fd121 Mon Sep 17 00:00:00 2001 From: Jonathon Turel Date: Sun, 22 Feb 2026 20:31:36 +0000 Subject: [PATCH 1/2] Remove candlepin events(artemis) --- lib/puppet/functions/katello/build_dn.rb | 20 -------------------- manifests/application.pp | 5 ----- manifests/candlepin.pp | 5 ----- manifests/init.pp | 1 - spec/acceptance/candlepin_spec.rb | 8 -------- spec/classes/application_spec.rb | 4 ---- spec/classes/init_spec.rb | 1 - spec/functions/katello_build_dn_spec.rb | 19 ------------------- templates/katello.yaml.erb | 5 ----- 9 files changed, 68 deletions(-) delete mode 100644 lib/puppet/functions/katello/build_dn.rb delete mode 100644 spec/functions/katello_build_dn_spec.rb diff --git a/lib/puppet/functions/katello/build_dn.rb b/lib/puppet/functions/katello/build_dn.rb deleted file mode 100644 index 08c70e09..00000000 --- a/lib/puppet/functions/katello/build_dn.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require 'yaml' -# @summary -# Convert an array of attribute pairs to a DN string, ignoring empty values -# -# @example Pass a set of -# $client_dn = katello::build_dn([['CN', 'foo.example.com'], ['O', 'my_org']]) -Puppet::Functions.create_function(:'katello::build_dn') do - # @param options - dispatch :build_dn do - param 'Array[Tuple[String[1], Optional[String]]]', :options - return_type 'String' - end - - def build_dn(options) - options_with_values = options.select { |_key, value| !value.nil? && value != '' } - options_with_values.map { |key, value| "#{key}=#{value}" }.join(', ') - end -end diff --git a/manifests/application.pp b/manifests/application.pp index 684ea3d0..cb3a8243 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -25,13 +25,8 @@ $candlepin_oauth_key = $katello::params::candlepin_oauth_key $candlepin_oauth_secret = $katello::params::candlepin_oauth_secret $candlepin_ca_cert = $certs::foreman::ssl_ca_cert - $candlepin_events_ssl_cert = $certs::foreman::client_cert - $candlepin_events_ssl_key = $certs::foreman::client_key $manage_db = $foreman::db_manage - # Used in Candlepin - $artemis_client_dn = katello::build_dn([['CN', $certs::foreman::hostname], ['OU', $certs::foreman::org_unit], ['O', $certs::foreman::org], ['ST', $certs::foreman::state], ['C', $certs::foreman::country]]) - # Katello database seeding needs candlepin Anchor <| title == 'katello::repo' or title == 'katello::candlepin' |> -> foreman::plugin { 'katello': diff --git a/manifests/candlepin.pp b/manifests/candlepin.pp index f550c801..da92a0d2 100644 --- a/manifests/candlepin.pp +++ b/manifests/candlepin.pp @@ -19,9 +19,6 @@ # The CA certificate to verify the SSL connection to the database with # @param manage_db # Whether to manage the database. Set this to false when using a remote database -# @param artemis_client_dn -# The Distinguished Name of the client certificate that's allowed to access -# Artemis. It should still be signed by the correct Certificate Authority. # @param loggers # Configure the Candlepin loggers # @param facts_match_regex @@ -36,7 +33,6 @@ Boolean $db_ssl_verify = true, Optional[Stdlib::Absolutepath] $db_ssl_ca = undef, Boolean $manage_db = true, - Variant[Undef, Deferred, String[1]] $artemis_client_dn = undef, Hash[String[1], Candlepin::LogLevel] $loggers = {}, Optional[String[1]] $facts_match_regex = undef, ) { @@ -60,7 +56,6 @@ keystore_password => $certs::candlepin::keystore_password, truststore_file => $certs::candlepin::truststore, truststore_password => $certs::candlepin::truststore_password, - artemis_client_dn => $artemis_client_dn, java_home => '/usr/lib/jvm/jre-17', java_package => 'java-17-openjdk', enable_basic_auth => false, diff --git a/manifests/init.pp b/manifests/init.pp index 9eb0eeea..a5c5dc47 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -81,7 +81,6 @@ db_ssl_verify => $candlepin_db_ssl_verify, db_ssl_ca => $candlepin_db_ssl_ca, manage_db => $candlepin_manage_db, - artemis_client_dn => $katello::application::artemis_client_dn, loggers => $candlepin_loggers, facts_match_regex => $candlepin_facts_match_regex, } diff --git a/spec/acceptance/candlepin_spec.rb b/spec/acceptance/candlepin_spec.rb index 36d531d4..749b33ae 100644 --- a/spec/acceptance/candlepin_spec.rb +++ b/spec/acceptance/candlepin_spec.rb @@ -19,12 +19,4 @@ describe command('curl -k -s -o /dev/null -w \'%{http_code}\' https://localhost:23443/candlepin/status') do its(:stdout) { should eq "200" } end - - describe file("/usr/share/tomcat/conf/cert-users.properties") do - it { should be_file } - it { should be_mode 640 } - it { should be_owned_by 'tomcat' } - it { should be_grouped_into 'tomcat' } - its(:content) { should eq("katelloUser=CN=ActiveMQ Artemis Client, OU=Artemis, O=ActiveMQ, L=AMQ, ST=AMQ, C=AMQ\n") } - end end diff --git a/spec/classes/application_spec.rb b/spec/classes/application_spec.rb index 113e577f..bd1decfb 100644 --- a/spec/classes/application_spec.rb +++ b/spec/classes/application_spec.rb @@ -49,10 +49,6 @@ class { 'katello::params': ' :oauth_key: "katello"', ' :oauth_secret: "candlepin-secret"', ' :ca_cert_file: /etc/foreman/proxy_ca.pem', - ' :candlepin_events:', - ' :ssl_cert_file: /etc/foreman/client_cert.pem', - ' :ssl_key_file: /etc/foreman/client_key.pem', - ' :ssl_ca_file: /etc/foreman/proxy_ca.pem', ] end diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 4676abf4..51cc891f 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -6,7 +6,6 @@ let(:facts) { facts } it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_class('katello::candlepin').with_artemis_client_dn('CN=foo.example.com, OU=PUPPET, O=FOREMAN, ST=North Carolina, C=US') } it { is_expected.to contain_class('katello::application') } it { is_expected.to contain_package('rubygem-katello').that_requires('Class[candlepin]') } it { is_expected.to contain_package('katello') } diff --git a/spec/functions/katello_build_dn_spec.rb b/spec/functions/katello_build_dn_spec.rb deleted file mode 100644 index fc9dda3c..00000000 --- a/spec/functions/katello_build_dn_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe 'katello::build_dn' do - it 'should exist' do - is_expected.not_to eq(nil) - end - - it 'should compute dn' do - is_expected.to run.with_params([['a', '1'], ['b', '2']]).and_return("a=1, b=2") - end - - it 'should compute dn and ignore empty values' do - is_expected.to run.with_params([['a', nil], ['b', '2']]).and_return("b=2") - end - - it 'should ignore empty strings' do - is_expected.to run.with_params([['a', ''], ['b', '2']]).and_return("b=2") - end -end diff --git a/templates/katello.yaml.erb b/templates/katello.yaml.erb index 42b13c7b..1b06ad5f 100644 --- a/templates/katello.yaml.erb +++ b/templates/katello.yaml.erb @@ -9,8 +9,3 @@ :oauth_key: "<%= @candlepin_oauth_key %>" :oauth_secret: "<%= @candlepin_oauth_secret %>" :ca_cert_file: <%= @candlepin_ca_cert %> - - :candlepin_events: - :ssl_cert_file: <%= @candlepin_events_ssl_cert %> - :ssl_key_file: <%= @candlepin_events_ssl_key %> - :ssl_ca_file: <%= @candlepin_ca_cert %> From 93789fb5450ee0cbf9c6cae0fb9f6cc189808b39 Mon Sep 17 00:00:00 2001 From: Jonathon Turel Date: Sun, 22 Feb 2026 22:52:10 +0000 Subject: [PATCH 2/2] Fix spec --- spec/acceptance/katello_spec.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec/acceptance/katello_spec.rb b/spec/acceptance/katello_spec.rb index 978bab16..fd8cc145 100644 --- a/spec/acceptance/katello_spec.rb +++ b/spec/acceptance/katello_spec.rb @@ -54,8 +54,4 @@ describe command('hammer --version') do its(:stdout) { is_expected.to match(/^hammer/) } end - - describe file("/usr/share/tomcat/conf/cert-users.properties") do - its(:content) { should eq("katelloUser=CN=#{fact('fqdn')}, OU=PUPPET, O=FOREMAN, ST=North Carolina, C=US\n") } - end end