puppet-manila/manifests/rabbitmq.pp
root 5b720d66d6 Manila hooks support
This code moves all deps to an external class so that Manila can be
installed with mechanisms besides packages (like venv or docker). This
also cleans-up the dependency tree by removing false or confusing
dependencies.

Change-Id: I053dbef10d51664d99e633abb714b3520a681e96
2016-10-28 11:29:34 +02:00

67 lines
1.8 KiB
Puppet

# == Class: manila::rabbitmq
#
# Installs and manages rabbitmq server for manila
#
# == 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) Deprecated. The port to use when connecting to Rabbit
# This parameter keeps backward compatibility when we used to manage
# RabbitMQ service.
# Defaults to '5672'
#
# [*virtual_host*]
# (optional) The virtual host to use when connecting to Rabbit
# Defaults to '/'
#
# [*enabled*]
# (optional) Deprecated. Whether to enable the Rabbit resources
# This parameter keeps backward compatibility when we used to manage
# RabbitMQ service.
# Defaults to true
#
class manila::rabbitmq(
$userid = 'guest',
$password = 'guest',
$virtual_host = '/',
# DEPRECATED PARAMETER
$enabled = true,
$port = '5672',
) {
include ::manila::deps
warning('manila::rabbitmq class is deprecated and will be removed in next release. Make other plans to configure rabbitmq resources.')
if ($enabled) {
if $userid == 'guest' {
$delete_guest_user = false
} else {
$delete_guest_user = true
rabbitmq_user { $userid:
admin => true,
password => $password,
provider => 'rabbitmqctl',
}
# I need to figure out the appropriate permissions
rabbitmq_user_permissions { "${userid}@${virtual_host}":
configure_permission => '.*',
write_permission => '.*',
read_permission => '.*',
provider => 'rabbitmqctl',
}->Anchor<| title == 'manila::service::begin' |>
}
rabbitmq_vhost { $virtual_host:
provider => 'rabbitmqctl',
}
}
}