Skip to content

Commit

Permalink
Merge pull request #119 from ekohl/simplify-qpid
Browse files Browse the repository at this point in the history
Simplify variables in katello::qpid
  • Loading branch information
stbenjam committed Apr 7, 2016
2 parents fb24289 + 8c78f15 commit 60be220
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@
ssl_cert_password_file => $certs::qpid::nss_db_password_file,
} ~>
class { '::katello::qpid':
client_cert => $certs::qpid::client_cert,
client_key => $certs::qpid::client_key,
katello_user => $katello::user,
client_cert => $certs::qpid::client_cert,
client_key => $certs::qpid::client_key,
} ~>
Exec['foreman-rake-db:seed']

Expand Down
21 changes: 11 additions & 10 deletions manifests/qpid.pp
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Katello Config
# Katello qpid Config
class katello::qpid (
$client_cert = undef,
$client_key = undef,
$katello_user = $katello::user
$client_cert,
$client_key,
$katello_user = $::katello::user,
$candlepin_event_queue = $::katello::candlepin_event_queue,
){
if $katello_user == undef {
fail('katello_user not defined')
} else {
Group['qpidd'] ->
User<|title == $katello_user|>{groups +> 'qpidd'}
}
exec { 'create katello entitlments queue':
command => "qpid-config --ssl-certificate ${katello::qpid::client_cert} --ssl-key ${katello::qpid::client_key} -b 'amqps://${::fqdn}:5671' add queue ${katello::params::candlepin_event_queue} --durable",
unless => "qpid-config --ssl-certificate ${katello::qpid::client_cert} --ssl-key ${katello::qpid::client_key} -b 'amqps://${::fqdn}:5671' queues ${katello::params::candlepin_event_queue}",
exec { 'create katello entitlements queue':
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' add queue ${candlepin_event_queue} --durable",
unless => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' queues ${candlepin_event_queue}",
path => '/usr/bin',
require => Service['qpidd'],
logoutput => true,
}
exec { 'bind katello entitlments queue to qpid exchange messages that deal with entitlements':
command => "qpid-config --ssl-certificate ${katello::qpid::client_cert} --ssl-key ${katello::qpid::client_key} -b 'amqps://${::fqdn}:5671' bind event ${katello::params::candlepin_event_queue} '*.*'",
onlyif => "qpid-config --ssl-certificate ${katello::qpid::client_cert} --ssl-key ${katello::qpid::client_key} -b 'amqps://${::fqdn}:5671' queues ${katello::params::candlepin_event_queue}",
exec { 'bind katello entitlements queue to qpid exchange messages that deal with entitlements':
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' bind event ${candlepin_event_queue} '*.*'",
onlyif => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' queues ${candlepin_event_queue}",
path => '/usr/bin',
require => Service['qpidd'],
logoutput => true,
Expand Down

0 comments on commit 60be220

Please # to comment.