2 # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
4 # Author: Emilien Macchi <emilien.macchi@enovance.com>
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # == Definition: openstacklib::messaging::rabbitmq
20 # This resource creates RabbitMQ resources for an OpenStack service.
25 # (optional) The username to use when connecting to Rabbit
29 # (optional) The password to use when connecting to Rabbit
33 # (optional) The virtual host to use when connecting to Rabbit
37 # (optional) If the user should be admin or not
40 # [*configure_permission*]
41 # (optional) Define configure permission
44 # [*write_permission*]
45 # (optional) Define write permission
49 # (optional) Define read permission
53 # (optional) Manage or not the user
56 # [*manage_user_permissions*]
57 # (optional) Manage or not user permissions
61 # (optional) Manage or not the vhost
64 define openstacklib::messaging::rabbitmq(
69 $configure_permission = '.*',
70 $write_permission = '.*',
71 $read_permission = '.*',
73 $manage_user_permissions = true,
78 if $userid == 'guest' {
79 $is_admin_real = false
81 $is_admin_real = $is_admin
83 ensure_resource('rabbitmq_user', $userid, {
84 'admin' => $is_admin_real,
85 'password' => $password,
86 'provider' => 'rabbitmqctl',
90 if $manage_user_permissions {
91 ensure_resource('rabbitmq_user_permissions', "${userid}@${virtual_host}", {
92 'configure_permission' => $configure_permission,
93 'write_permission' => $write_permission,
94 'read_permission' => $read_permission,
95 'provider' => 'rabbitmqctl',
100 ensure_resource('rabbitmq_vhost', $virtual_host, {
101 'provider' => 'rabbitmqctl',