Skip to content

Commit

Permalink
Refs #28924 - Drop qpid, add Artemis
Browse files Browse the repository at this point in the history
  • Loading branch information
jturel authored and ehelms committed Apr 20, 2020
1 parent 3c6fc2c commit 05604d3
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 73 deletions.
5 changes: 3 additions & 2 deletions manifests/application.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
include foreman
include certs
include certs::apache
include certs::candlepin
include certs::foreman
include certs::pulp_client
include certs::qpid
Expand Down Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions manifests/candlepin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 0 additions & 17 deletions manifests/qpid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
) {
include certs
include certs::qpid
include katello::params

class { 'qpid':
ssl => true,
Expand All @@ -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
}
21 changes: 12 additions & 9 deletions spec/classes/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down
11 changes: 0 additions & 11 deletions spec/classes/candlepin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 0 additions & 16 deletions spec/classes/qpid_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions templates/katello.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand All @@ -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 %>
Expand Down

0 comments on commit 05604d3

Please sign in to comment.