From 05604d348d1ce2aa9db9af7f90b20072371fa32e Mon Sep 17 00:00:00 2001 From: Jonathon Turel Date: Mon, 20 Apr 2020 14:39:35 -0400 Subject: [PATCH] Refs #28924 - Drop qpid, add Artemis --- manifests/application.pp | 5 +++-- manifests/candlepin.pp | 10 +--------- manifests/globals.pp | 3 --- manifests/qpid.pp | 17 ----------------- spec/classes/application_spec.rb | 21 ++++++++++++--------- spec/classes/candlepin_spec.rb | 11 ----------- spec/classes/init_spec.rb | 2 -- spec/classes/qpid_spec.rb | 16 ---------------- templates/katello.yaml.erb | 9 +++++---- 9 files changed, 21 insertions(+), 73 deletions(-) diff --git a/manifests/application.pp b/manifests/application.pp index c4c62142..3fdb5a0f 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -21,6 +21,7 @@ include foreman include certs include certs::apache + include certs::candlepin include certs::foreman include certs::pulp_client include certs::qpid @@ -59,8 +60,8 @@ $candlepin_oauth_key = $katello::params::candlepin_oauth_key $candlepin_oauth_secret = $katello::params::candlepin_oauth_secret $candlepin_ca_cert = $certs::ca_cert - $qpid_url = "amqp:ssl:${katello::params::qpid_hostname}:5671" - $candlepin_event_queue = $katello::params::candlepin_event_queue + $candlepin_events_ssl_cert = $certs::candlepin::client_cert + $candlepin_events_ssl_key = $certs::candlepin::client_key $crane_url = $katello::params::crane_url $crane_ca_cert = $certs::katello_server_ca_cert $postgresql_evr_package = $katello::params::postgresql_evr_package diff --git a/manifests/candlepin.pp b/manifests/candlepin.pp index d964fa44..ec907cc8 100644 --- a/manifests/candlepin.pp +++ b/manifests/candlepin.pp @@ -34,7 +34,6 @@ hostname => $katello::params::candlepin_host, } - Anchor <| title == 'katello::qpid::event_queue' |> -> # lint:ignore:anchor_resource class { 'candlepin': host => $katello::params::candlepin_host, user_groups => $certs::candlepin::group, @@ -45,17 +44,10 @@ keystore_file => $certs::candlepin::keystore, keystore_password => $certs::candlepin::keystore_password, truststore_password => $certs::candlepin::keystore_password, + artemis_client_dn => $certs::candlepin::artemis_client_dn, enable_basic_auth => false, consumer_system_name_pattern => '.+', adapter_module => 'org.candlepin.katello.KatelloModule', - amq_enable => true, - amqp_keystore_password => $certs::candlepin::keystore_password, - amqp_truststore_password => $certs::candlepin::keystore_password, - amqp_keystore => $certs::candlepin::amqp_keystore, - amqp_truststore => $certs::candlepin::amqp_truststore, - qpid_hostname => $katello::params::qpid_hostname, - qpid_ssl_cert => $certs::candlepin::client_cert, - qpid_ssl_key => $certs::candlepin::client_key, db_host => $db_host, db_port => $db_port, db_name => $db_name, diff --git a/manifests/globals.pp b/manifests/globals.pp index 17ceb33e..ce74e5eb 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -30,9 +30,6 @@ $candlepin_oauth_key = 'katello' $candlepin_oauth_secret = extlib::cache_data('foreman_cache_data', 'candlepin_oauth_secret', extlib::random_password(32)) - $candlepin_qpid_exchange = 'event' - $candlepin_event_queue = 'katello_event_queue' - if $facts['os']['release']['major'] == '7' { $postgresql_evr_package = 'rh-postgresql12-postgresql-evr' } else { diff --git a/manifests/qpid.pp b/manifests/qpid.pp index eba253d9..319869fb 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -12,7 +12,6 @@ ) { include certs include certs::qpid - include katello::params class { 'qpid': ssl => true, @@ -26,20 +25,4 @@ } contain qpid - - qpid::config::queue { $katello::params::candlepin_event_queue: - ssl_cert => $certs::qpid::client_cert, - ssl_key => $certs::qpid::client_key, - hostname => $katello::params::qpid_hostname, - } - - qpid::config::bind { ['entitlement.created', 'entitlement.deleted', 'pool.created', 'pool.deleted', 'compliance.created', 'system_purpose_compliance.created']: - queue => $katello::params::candlepin_event_queue, - exchange => $katello::params::candlepin_qpid_exchange, - ssl_cert => $certs::qpid::client_cert, - ssl_key => $certs::qpid::client_key, - hostname => $katello::params::qpid_hostname, - } -> - # This anchor indicates the event queue is all set up. - anchor { 'katello::qpid::event_queue': } # lint:ignore:anchor_resource } diff --git a/spec/classes/application_spec.rb b/spec/classes/application_spec.rb index 5ba78daf..53a9a45b 100644 --- a/spec/classes/application_spec.rb +++ b/spec/classes/application_spec.rb @@ -76,15 +76,16 @@ class { 'katello::params': ' :oauth_key: "katello"', ' :oauth_secret: "candlepin-secret"', ' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt', + ' :candlepin_events:', + ' :ssl_cert_file: /etc/pki/katello/certs/java-client.crt', + ' :ssl_key_file: /etc/pki/katello/private/java-client.key', + ' :ssl_ca_file: /etc/pki/katello/certs/katello-default-ca.crt', ' :pulp:', ' :url: https://foo.example.com/pulp/api/v2/', ' :ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt', ' :use_pulp_2_for_content_type:', ' :docker: false', ' :file: false', - ' :qpid:', - ' :url: amqp:ssl:localhost:5671', - ' :subscriptions_queue_address: katello_event_queue', ' :container_image_registry:', ' :crane_url: https://foo.example.com:5000', ' :crane_ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt' @@ -133,15 +134,16 @@ class { 'katello::params': ' :oauth_key: "katello"', ' :oauth_secret: "candlepin-secret"', ' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt', + ' :candlepin_events:', + ' :ssl_cert_file: /etc/pki/katello/certs/java-client.crt', + ' :ssl_key_file: /etc/pki/katello/private/java-client.key', + ' :ssl_ca_file: /etc/pki/katello/certs/katello-default-ca.crt', ' :pulp:', ' :url: https://foo.example.com/pulp/api/v2/', ' :ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt', ' :use_pulp_2_for_content_type:', ' :docker: false', ' :file: false', - ' :qpid:', - ' :url: amqp:ssl:localhost:5671', - ' :subscriptions_queue_address: katello_event_queue', ' :container_image_registry:', ' :crane_url: https://foo.example.com:5000', ' :crane_ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt', @@ -177,15 +179,16 @@ class {'katello::globals': ' :oauth_key: "katello"', ' :oauth_secret: "candlepin-secret"', ' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt', + ' :candlepin_events:', + ' :ssl_cert_file: /etc/pki/katello/certs/java-client.crt', + ' :ssl_key_file: /etc/pki/katello/private/java-client.key', + ' :ssl_ca_file: /etc/pki/katello/certs/katello-default-ca.crt', ' :pulp:', ' :url: https://foo.example.com/pulp/api/v2/', ' :ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt', ' :use_pulp_2_for_content_type:', ' :docker: false', ' :file: false', - ' :qpid:', - ' :url: amqp:ssl:localhost:5671', - ' :subscriptions_queue_address: katello_event_queue', ' :container_image_registry:', ' :crane_url: https://foo.example.com:5000', ' :crane_ca_cert_file: /etc/pki/katello/certs/katello-server-ca.crt' diff --git a/spec/classes/candlepin_spec.rb b/spec/classes/candlepin_spec.rb index 90526952..4a0d20a7 100644 --- a/spec/classes/candlepin_spec.rb +++ b/spec/classes/candlepin_spec.rb @@ -9,17 +9,6 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('certs::candlepin').that_notifies('Service[tomcat]') } it { is_expected.to create_class('candlepin') } - it { is_expected.not_to contain_class('candlepin').that_requires('Anchor[katello::qpid::event_queue]') } - end - - context 'with qpid parameters' do - let(:pre_condition) { 'include katello::qpid' } - - it 'should require a complete event queue' do - is_expected.to compile.with_all_deps - is_expected.to contain_anchor('katello::qpid::event_queue') - is_expected.to create_class('candlepin').that_requires('Anchor[katello::qpid::event_queue]') - end end end end diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 2d867d44..045e7c69 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -13,8 +13,6 @@ it { is_expected.to contain_class('katello::qpid') } it { is_expected.to contain_package('tfm-rubygem-katello').that_requires('Class[candlepin]') } - - it { is_expected.to contain_service('tomcat').that_requires('Qpid::Config::Bind[entitlement.created]') } end end end diff --git a/spec/classes/qpid_spec.rb b/spec/classes/qpid_spec.rb index 956e5320..ee5e7335 100644 --- a/spec/classes/qpid_spec.rb +++ b/spec/classes/qpid_spec.rb @@ -9,22 +9,6 @@ it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('certs::qpid').that_notifies(['Service[qpidd]', 'Class[qpid]']) } it { is_expected.to create_class('qpid').with_wcache_page_size(4).with_interface('lo') } - - it do - is_expected.to create_qpid__config__queue('katello_event_queue') - .with_ssl_cert('/etc/pki/katello/certs/foo.example.com-qpid-broker.crt') - .with_ssl_key('/etc/pki/katello/private/foo.example.com-qpid-broker.key') - end - - ['entitlement.created', 'entitlement.deleted', 'pool.created', 'pool.deleted', 'compliance.created', 'system_purpose_compliance.created'].each do |binding| - it do - is_expected.to create_qpid__config__bind(binding) - .with_queue('katello_event_queue') - .with_exchange('event') - .with_ssl_cert('/etc/pki/katello/certs/foo.example.com-qpid-broker.crt') - .with_ssl_key('/etc/pki/katello/private/foo.example.com-qpid-broker.key') - end - end end context 'with overridden parameters' do diff --git a/templates/katello.yaml.erb b/templates/katello.yaml.erb index adb1e135..b106863a 100644 --- a/templates/katello.yaml.erb +++ b/templates/katello.yaml.erb @@ -18,6 +18,11 @@ :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 %> + :pulp: :url: <%= @pulp_url %> :ca_cert_file: <%= @pulp_ca_cert %> @@ -26,10 +31,6 @@ :docker: <%= @use_pulp_2_for_docker %> :file: <%= @use_pulp_2_for_file %> - :qpid: - :url: <%= @qpid_url %> - :subscriptions_queue_address: <%= @candlepin_event_queue %> - # Internal configuration for communication from server to pulp crane service. :container_image_registry: :crane_url: <%= @crane_url %>