From fbc4a6342363857116c69288bbe5573d9fe80a26 Mon Sep 17 00:00:00 2001 From: Eric D Helms Date: Fri, 24 Mar 2017 10:56:18 -0400 Subject: [PATCH] Switch to using qpid bind --- manifests/params.pp | 1 + manifests/qpid.pp | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 12df03be..00feb410 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -63,5 +63,6 @@ $qpid_url = 'amqp:ssl:localhost:5671' $candlepin_event_queue = 'katello_event_queue' + $candlepin_qpid_exchange = 'event' $enable_ostree = false } diff --git a/manifests/qpid.pp b/manifests/qpid.pp index f3d0c850..13fa5f46 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -2,8 +2,9 @@ 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') @@ -11,22 +12,20 @@ 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, } }