puppet-openstack-integration/manifests/mq_user.pp
Mohammed Naser a52d9564c0
Refactor usage of RabbitMQ resources
This patch refactors all creation of RabbitMQ resources such
as users and ACLs to a define called openstack_integration::mq_user.

This will make sure RabbitMQ is automatically installed as well,
as there are times where dependencies to RabbitMQ are added to things
like Keystone which break Beaker tests in other repos (but we don't
know they're broken until the change merges).

In addition, instead of setting up dependencies on the tagged services,
we use the anchors provided which should hopefully test against them
as well.

Change-Id: Ib122ddd105529de5e12389cc9db2e4e09ec4ad54
2017-09-15 09:10:25 -04:00

46 lines
1.1 KiB
Puppet

# Create a message queue user for a service
#
# [*password*]
# The password for the message queue account
#
# [*admin*]
# (optional) If the acconut is an admin account
# Defaults to true
#
# [*vhost*]
# The virtual host assigned to the user
# Defaults to /
#
define openstack_integration::mq_user (
$password,
$admin = true,
$vhost = '/',
) {
include ::openstack_integration::config
include ::openstack_integration::rabbitmq
rabbitmq_user { $name:
admin => $admin,
password => $password,
provider => 'rabbitmqctl',
require => Class['::rabbitmq'],
}
rabbitmq_user_permissions { "${name}@${vhost}":
configure_permission => '.*',
write_permission => '.*',
read_permission => '.*',
provider => 'rabbitmqctl',
require => Class['::rabbitmq'],
}
if $::openstack_integration::config::messaging_default_proto == 'amqp' {
include ::openstack_integration::qdr
qdr_user { $name:
password => $password,
provider => 'sasl',
require => Class['::qdr'],
}
}
}