diff --git a/defaults/main.yml b/defaults/main.yml index 79481b1c..e8ede18c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -78,6 +78,10 @@ keystone_database_min_pool_size: 5 keystone_database_max_pool_size: 120 keystone_database_pool_timeout: 30 +## RabbitMQ info +keystone_rabbitmq_userid: keystone +keystone_rabbitmq_vhost: /keystone + ## Role info keystone_role_name: admin keystone_default_role_name: _member_ diff --git a/tasks/keystone_messaging_setup.yml b/tasks/keystone_messaging_setup.yml new file mode 100644 index 00000000..ddd11c23 --- /dev/null +++ b/tasks/keystone_messaging_setup.yml @@ -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: "{{ keystone_rabbitmq_vhost }}" + state: "present" + delegate_to: "{{ groups['rabbitmq_all'][0] }}" + tags: + - keystone-rabbitmq + - keystone-rabbitmq-vhost + +- name: Ensure rabbitmq user + rabbitmq_user: + user: "{{ keystone_rabbitmq_userid }}" + password: "{{ keystone_rabbitmq_password }}" + vhost: "{{ keystone_rabbitmq_vhost }}" + configure_priv: ".*" + read_priv: ".*" + write_priv: ".*" + state: "present" + delegate_to: "{{ groups['rabbitmq_all'][0] }}" + tags: + - keystone-rabbitmq + - keystone-rabbitmq-user diff --git a/tasks/keystone_pre_install.yml b/tasks/keystone_pre_install.yml index 1816ebf9..b75ababc 100644 --- a/tasks/keystone_pre_install.yml +++ b/tasks/keystone_pre_install.yml @@ -106,3 +106,7 @@ tags: - keystone-dirs - keystone-logs + +- include: keystone_messaging_setup.yml + when: > + inventory_hostname == groups['keystone_all'][0] diff --git a/templates/keystone.conf.j2 b/templates/keystone.conf.j2 index d2276353..802904e6 100644 --- a/templates/keystone.conf.j2 +++ b/templates/keystone.conf.j2 @@ -134,9 +134,11 @@ admin_port = {{ keystone_admin_port }} public_port = {{ keystone_service_port }} [oslo_messaging_rabbit] +rabbit_port = {{ rabbitmq_port }} +rabbit_userid = {{ keystone_rabbitmq_userid }} +rabbit_password = {{ keystone_rabbitmq_password }} +rabbit_virtual_host = {{ keystone_rabbitmq_vhost }} rabbit_hosts = {{ rabbitmq_servers }} -rabbit_userid = {{ rabbitmq_userid }} -rabbit_password = {{ rabbitmq_password }} {% if keystone_sp is defined %} [federation] @@ -147,3 +149,4 @@ trusted_dashboard = {{ item }} {% endfor %} {% endif %} {% endif %} +