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

Simplify variables in katello::qpid #119

Merged
merged 1 commit into from
Apr 7, 2016
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
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this variable in $::katello, the exec below was referencing $::katello::params::candlepin_event_queue Maybe candlepin_event_queue could be a param on the qpid class itself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the katello class inherits from params so that way it should be available. By using it this way you can easily make it a real parameter later on.

){
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