Skip to content

Commit

Permalink
Switch to using qpid bind
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Mar 24, 2017
1 parent ba8aae6 commit fbc4a63
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
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,
}
}

0 comments on commit fbc4a63

Please # to comment.