Refactor usage of puppet-rabbitmq

This refactors current usage of puppet-rabbitmq. Details follow below.

- the rabbitmql class supports the ipv6 parameter which injects
  the required definitions to use IPv6

- ssl options are ignored if rabbitlqm::ssl is false

- we can use native parameters to define the bind address

Change-Id: Id33b56f84b04f0086f0e19e1938f36d109e4a188
This commit is contained in:
Takashi Kajinami 2023-03-07 23:29:47 +09:00
parent 863628b2fe
commit fe83b5488d
3 changed files with 32 additions and 36 deletions

View File

@ -101,6 +101,9 @@ fi
if [ -d /var/log/rabbitmq ]; then
sudo cp -r /var/log/rabbitmq $LOG_DIR
fi
if [ -f /var/lib/rabbitmq/erl_crash.dump ]; then
sudo cp /var/lib/rabbitmq/erl_crash.dump $LOG_DIR
fi
# db logs
# postgresql

View File

@ -48,27 +48,17 @@ class openstack_integration::config (
$rabbit_port = $messaging_notify_port
if $ipv6 {
$host = '::1'
if $rpc_backend == 'rabbit' {
$rabbit_env = {
'RABBITMQ_NODE_IP_ADDRESS' => $host,
'RABBITMQ_SERVER_START_ARGS' => '"-proto_dist inet6_tcp"',
'LC_ALL' => 'en_US.UTF-8',
}
}
$ip_version = '6'
$host = '::1'
$ip_version = '6'
# Note (dmsimard): ipv6 parsing in Swift and keystone_authtoken are
# different: https://bugs.launchpad.net/swift/+bug/1610064
$memcached_servers = ["inet6:[${host}]:11211"]
$memcached_servers = ["inet6:[${host}]:11211"]
$swift_memcached_servers = ["[${host}]:11211"]
$tooz_url = "redis://[${host}]:6379"
} else {
$host = '127.0.0.1'
$rabbit_env = {
'LC_ALL' => 'en_US.UTF-8',
}
$ip_version = '4'
$memcached_servers = ["${host}:11211"]
$host = '127.0.0.1'
$ip_version = '4'
$memcached_servers = ["${host}:11211"]
$swift_memcached_servers = $memcached_servers
$tooz_url = "redis://${host}:6379"
}

View File

@ -16,26 +16,29 @@ class openstack_integration::rabbitmq {
require => File['/etc/rabbitmq/ssl/private'],
notify => Service['rabbitmq-server'],
}
class { 'rabbitmq':
package_provider => $facts['package_provider'],
delete_guest_user => true,
ssl => true,
ssl_only => true,
ssl_cacert => $::openstack_integration::params::ca_bundle_cert_path,
ssl_cert => $::openstack_integration::params::cert_path,
ssl_key => "/etc/rabbitmq/ssl/private/${facts['networking']['fqdn']}.pem",
environment_variables => $::openstack_integration::config::rabbit_env,
repos_ensure => false,
manage_python => false,
}
} else {
class { 'rabbitmq':
package_provider => $facts['package_provider'],
delete_guest_user => true,
environment_variables => $::openstack_integration::config::rabbit_env,
repos_ensure => false,
manage_python => false,
}
}
class { 'rabbitmq':
package_provider => $facts['package_provider'],
delete_guest_user => true,
ssl => $::openstack_integration::config::ssl,
ssl_only => $::openstack_integration::config::ssl,
# the parameters below are ignored when ssl is false
ssl_cacert => $::openstack_integration::params::ca_bundle_cert_path,
ssl_cert => $::openstack_integration::params::cert_path,
ssl_key => "/etc/rabbitmq/ssl/private/${facts['networking']['fqdn']}.pem",
environment_variables => {
'LC_ALL' => 'en_US.UTF-8',
},
repos_ensure => false,
manage_python => false,
# the interface parameter is ignored if ssl_only is true
interface => $::openstack_integration::config::host,
# the ssl_interface parameter is ignored if ssl is false
ssl_interface => $::openstack_integration::config::host,
node_ip_address => $::openstack_integration::config::host,
management_ip_address => $::openstack_integration::config::host,
ipv6 => $::openstack_integration::config::ipv6,
}
rabbitmq_vhost { '/':
provider => 'rabbitmqctl',