
This patch fixes all remaining parameter documentation in the nova module to be compatible with puppet-doc and documents all parameters in a standard way. Change-Id: I451078d46cb2498dd8e3c23bd8cbcc81b8845fcd
92 lines
2.4 KiB
Puppet
92 lines
2.4 KiB
Puppet
# == Class: nova::rabbitmq
|
|
#
|
|
# Installs and manages rabbitmq server for nova
|
|
#
|
|
# == Parameters:
|
|
#
|
|
# [*userid*]
|
|
# (optional) The username to use when connecting to Rabbit
|
|
# Defaults to 'guest'
|
|
#
|
|
# [*password*]
|
|
# (optional) The password to use when connecting to Rabbit
|
|
# Defaults to 'guest'
|
|
#
|
|
# [*port*]
|
|
# (optional) The port to use when connecting to Rabbit
|
|
# Defaults to '5672'
|
|
#
|
|
# [*virtual_host*]
|
|
# (optional) The virtual host to use when connecting to Rabbit
|
|
# Defaults to '/'
|
|
#
|
|
# [*cluster_disk_nodes*]
|
|
# (optional) Enables/disables RabbitMQ clustering. Specify an array of Rabbit Broker
|
|
# IP addresses to configure clustering.
|
|
# Defaults to false
|
|
#
|
|
# [*enabled*]
|
|
# (optional) Whether to enable the Rabbit service
|
|
# Defaults to false
|
|
#
|
|
class nova::rabbitmq(
|
|
$userid ='guest',
|
|
$password ='guest',
|
|
$port ='5672',
|
|
$virtual_host ='/',
|
|
$cluster_disk_nodes = false,
|
|
$enabled = true
|
|
) {
|
|
|
|
# only configure nova after the queue is up
|
|
Class['rabbitmq::service'] -> Anchor<| title == 'nova-start' |>
|
|
|
|
if ($enabled) {
|
|
if $userid == 'guest' {
|
|
$delete_guest_user = false
|
|
} else {
|
|
$delete_guest_user = true
|
|
rabbitmq_user { $userid:
|
|
admin => true,
|
|
password => $password,
|
|
provider => 'rabbitmqctl',
|
|
require => Class['rabbitmq::server'],
|
|
}
|
|
# I need to figure out the appropriate permissions
|
|
rabbitmq_user_permissions { "${userid}@${virtual_host}":
|
|
configure_permission => '.*',
|
|
write_permission => '.*',
|
|
read_permission => '.*',
|
|
provider => 'rabbitmqctl',
|
|
}->Anchor<| title == 'nova-start' |>
|
|
}
|
|
$service_ensure = 'running'
|
|
} else {
|
|
$service_ensure = 'stopped'
|
|
}
|
|
|
|
if $cluster_disk_nodes {
|
|
class { 'rabbitmq::server':
|
|
service_ensure => $service_ensure,
|
|
port => $port,
|
|
delete_guest_user => $delete_guest_user,
|
|
config_cluster => true,
|
|
cluster_disk_nodes => $cluster_disk_nodes,
|
|
wipe_db_on_cookie_change => true,
|
|
}
|
|
} else {
|
|
class { 'rabbitmq::server':
|
|
service_ensure => $service_ensure,
|
|
port => $port,
|
|
delete_guest_user => $delete_guest_user,
|
|
}
|
|
}
|
|
|
|
if ($enabled) {
|
|
rabbitmq_vhost { $virtual_host:
|
|
provider => 'rabbitmqctl',
|
|
require => Class['rabbitmq::server'],
|
|
}
|
|
}
|
|
}
|