onlyif does not work as it supposed to and it failing Puppet with: Debug: /Stage[main]/Main/Enable_qpid[qpid]/Exec[install_qpid_ssl]/onlyif: Error: No matching Packages to list While from Puppet PoV this is valid message, we would need to add special error ignore rule in Packstack just for this case. Because separate ssl package for QPID won't be used for Juno+, this rule is removed. Backports to Icehouse- has to have the special error ignore rule instead. Change-Id: Ieb637094fb89bacb9ef6f1cafd38e1b56d044ef1 Fixes: rhbz#1179859
102 lines
2.8 KiB
Puppet
102 lines
2.8 KiB
Puppet
$amqp = hiera('CONFIG_AMQP_BACKEND')
|
|
|
|
case $amqp {
|
|
'qpid': {
|
|
enable_qpid { 'qpid':
|
|
enable_ssl => hiera('CONFIG_AMQP_ENABLE_SSL'),
|
|
enable_auth => hiera('CONFIG_AMQP_ENABLE_AUTH'),
|
|
}
|
|
}
|
|
'rabbitmq': {
|
|
enable_rabbitmq { 'rabbitmq': }
|
|
}
|
|
default: {}
|
|
}
|
|
|
|
|
|
define enable_rabbitmq {
|
|
package { 'erlang':
|
|
ensure => 'installed',
|
|
}
|
|
|
|
class { 'rabbitmq':
|
|
port => hiera('CONFIG_AMQP_CLIENTS_PORT'),
|
|
ssl_management_port => hiera('CONFIG_AMQP_SSL_PORT'),
|
|
ssl => hiera('CONFIG_AMQP_ENABLE_SSL'),
|
|
ssl_cert => hiera('CONFIG_AMQP_SSL_CERT_FILE'),
|
|
ssl_key => hiera('CONFIG_AMQP_SSL_KEY_FILE'),
|
|
default_user => hiera('CONFIG_AMQP_AUTH_USER'),
|
|
default_pass => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
|
package_provider => 'yum',
|
|
admin_enable => false,
|
|
config_variables => {
|
|
'tcp_listen_options' => "[binary,{packet, raw},{reuseaddr, true},{backlog, 128},{nodelay, true},{exit_on_close, false},{keepalive, true}]",
|
|
'loopback_users' => "[]",
|
|
}
|
|
}
|
|
|
|
Package['erlang'] -> Class['rabbitmq']
|
|
}
|
|
|
|
define enable_qpid($enable_ssl = 'n', $enable_auth = 'n') {
|
|
case $::operatingsystem {
|
|
'Fedora': {
|
|
if (is_integer($::operatingsystemrelease) and $::operatingsystemrelease >= 20) or $::operatingsystemrelease == 'Rawhide' {
|
|
$config = '/etc/qpid/qpidd.conf'
|
|
} else {
|
|
$config = '/etc/qpidd.conf'
|
|
}
|
|
}
|
|
|
|
'RedHat', 'CentOS', 'Scientific': {
|
|
if $::operatingsystemmajrelease >= 7 {
|
|
$config = '/etc/qpid/qpidd.conf'
|
|
} else {
|
|
$config = '/etc/qpidd.conf'
|
|
}
|
|
}
|
|
|
|
default: {
|
|
$config = '/etc/qpidd.conf'
|
|
}
|
|
}
|
|
|
|
class { 'qpid::server':
|
|
config_file => $config,
|
|
auth => $enable_auth ? {
|
|
'y' => 'yes',
|
|
default => 'no',
|
|
},
|
|
clustered => false,
|
|
ssl_port => hiera('CONFIG_AMQP_SSL_PORT'),
|
|
ssl => hiera('CONFIG_AMQP_ENABLE_SSL'),
|
|
ssl_cert => hiera('CONFIG_AMQP_SSL_CERT_FILE'),
|
|
ssl_key => hiera('CONFIG_AMQP_SSL_KEY_FILE'),
|
|
ssl_database_password => hiera('CONFIG_AMQP_NSS_CERTDB_PW'),
|
|
}
|
|
|
|
if $enable_auth == 'y' {
|
|
add_qpid_user { 'qpid_user': }
|
|
}
|
|
|
|
}
|
|
|
|
define add_qpid_user {
|
|
$config_amqp_auth_user = hiera('CONFIG_AMQP_AUTH_USER')
|
|
qpid_user { $config_amqp_auth_user:
|
|
password => hiera('CONFIG_AMQP_AUTH_PASSWORD'),
|
|
file => '/var/lib/qpidd/qpidd.sasldb',
|
|
realm => 'QPID',
|
|
provider => 'saslpasswd2',
|
|
require => Class['qpid::server'],
|
|
}
|
|
|
|
file { 'sasldb_file':
|
|
ensure => file,
|
|
path => '/var/lib/qpidd/qpidd.sasldb',
|
|
owner => 'qpidd',
|
|
group => 'qpidd',
|
|
require => Package['qpid-cpp-server'],
|
|
}
|
|
}
|