Compartmentalizing RabbitMQ

Presently all services use the single root virtual host within RabbitMQ
and while this is “OK” for small to mid sized deployments however it
would be better to divide services into logical resource groups within
RabbitMQ which will bring with it additional security. This change set
provides OSAD better compartmentalization of consumer services that use
RabbitMQ.

UpgradeImpact
DocImpact
Change-Id: I6f9d07522faf133f3c1c84a5b9046a55d5789e52
Implements: blueprint compartmentalize-rabbitmq
This commit is contained in:
kevin 2015-07-16 14:55:47 -05:00
parent 9a407d7b09
commit 54c18cd99f
5 changed files with 51 additions and 3 deletions

View File

@ -47,6 +47,10 @@ glance_enable_v1_registry: True
glance_enable_v2_api: True
glance_enable_v2_registry: True
## RabbitMQ info
glance_rabbitmq_userid: glance
glance_rabbitmq_vhost: /glance
## DB info
glance_galera_database: glance
glance_galera_user: glance

View File

@ -0,0 +1,37 @@
---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ glance_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- glance-rabbitmq
- glance-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ glance_rabbitmq_userid }}"
password: "{{ glance_rabbitmq_password }}"
vhost: "{{ glance_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- glance-rabbitmq
- glance-rabbitmq-user

View File

@ -80,3 +80,7 @@
tags:
- glance-dirs
- glance-logs
- include: glance_messaging_setup.yml
when: >
inventory_hostname == groups['glance_all'][0]

View File

@ -35,8 +35,9 @@ notification_driver = {{ glance_notification_driver }}
rpc_backend = {{ glance_rpc_backend }}
rabbit_hosts = {{ rabbitmq_servers }}
rabbit_port = {{ rabbitmq_port }}
rabbit_userid = {{ rabbitmq_userid }}
rabbit_password = {{ rabbitmq_password }}
rabbit_userid = {{ glance_rabbitmq_userid }}
rabbit_password = {{ glance_rabbitmq_password }}
rabbit_virtual_host = {{ glance_rabbitmq_vhost }}
rabbit_notification_exchange = glance
rabbit_notification_topic = notifications
rabbit_durable_queues = False

View File

@ -20,7 +20,9 @@ limit_param_default = 25
notification_driver = {{ glance_notification_driver }}
rpc_backend = {{ glance_rpc_backend }}
rabbit_hosts = {{ rabbitmq_servers }}
rabbit_password = {{ rabbitmq_password }}
rabbit_userid = {{ glance_rabbitmq_userid }}
rabbit_password = {{ glance_rabbitmq_password }}
rabbit_virtual_host = {{ glance_rabbitmq_vhost }}
{% endif %}
[database]