Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switch to using qpid bind #177

Merged
merged 1 commit into from
Mar 27, 2017
Merged
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
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@

$qpid_url = 'amqp:ssl:localhost:5671'
$candlepin_event_queue = 'katello_event_queue'
$candlepin_qpid_exchange = 'event'
$enable_ostree = false
}
31 changes: 15 additions & 16 deletions manifests/qpid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@
class katello::qpid (
$client_cert,
$client_key,
$katello_user = $::katello::user,
$candlepin_event_queue = $::katello::candlepin_event_queue,
$katello_user = $::katello::user,
$candlepin_event_queue = $::katello::candlepin_event_queue,
$candlepin_qpid_exchange = $::katello::candlepin_qpid_exchange,
){
if $katello_user == undef {
fail('katello_user not defined')
} else {
Group['qpidd'] ->
User<|title == $katello_user|>{groups +> 'qpidd'}
}
exec { 'delete katello entitlements queue if bound to *.*':
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' del queue ${candlepin_event_queue} --force",
onlyif => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' list binding | grep ${candlepin_event_queue} | grep '*.*'",
path => '/usr/bin',
require => Service['qpidd'],
logoutput => true,

qpid::config_cmd {'delete katello entitlements queue if bound to *.*':
command => "del queue ${candlepin_event_queue} --force",
onlyif => "list binding | grep ${candlepin_event_queue} | grep '*.*'",
ssl_cert => $client_cert,
} ->
exec { 'create katello entitlements queue':
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' add queue ${candlepin_event_queue} --durable",
unless => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' queues ${candlepin_event_queue}",
path => '/usr/bin',
require => Service['qpidd'],
logoutput => true,
} ~>
qpid::bind_event { ['entitlement.created', 'entitlement.deleted', 'pool.created', 'pool.deleted', 'compliance.created']:
qpid::config_cmd { 'create katello entitlements queue':
command => "add queue ${candlepin_event_queue} --durable",
unless => "queues ${candlepin_event_queue}",
ssl_cert => $client_cert,
} ->
qpid::config::bind { ['entitlement.created', 'entitlement.deleted', 'pool.created', 'pool.deleted', 'compliance.created']:
queue => $candlepin_event_queue,
exchange => $candlepin_qpid_exchange,
ssl_cert => $client_cert,
}
}