Moving RabbitMQ setup to PreTasks

Moving RabbitMQ setup from role to PreTasks.

Change-Id: I6479cccf38f147b203dc65187aa5e70b116c1a10
This commit is contained in:
Chris Hultin 2016-06-16 09:45:04 -05:00
parent 03ff822c9f
commit 6f8371f140
4 changed files with 34 additions and 53 deletions

View File

@ -73,7 +73,7 @@ magnum_galera_user: magnum
# Rabbit vars
magnum_rpc_backend: rabbit
magnum_rabbitmq_userid: magnum
magnum_rabbitmq_virtualhost: /magnum
magnum_rabbitmq_vhost: /magnum
# Keystone AuthToken/Middleware
magnum_keystone_auth_plugin: password

View File

@ -44,6 +44,37 @@
retries: 3
tags:
- ssh-wait
- name: Sort the rabbitmq servers
dist_sort:
value_to_lookup: "{{ container_name }}"
ref_list: "{{ groups['magnum_all'] }}"
src_list: "{{ rabbitmq_servers }}"
register: servers
- name: Set rabbitmq servers
set_fact:
rabbitmq_servers: "{{ servers.sorted_list }}"
- name: Ensure the Magnum RabbitMQ virtualhost exists
rabbitmq_vhost:
name: "{{ magnum_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- magnum-rabbitmq
- magnum-rabbitmq-vhost
- magnum-rabbitmq-virtualhost
- name: Ensure the Magnum RabbitMQ user exists
rabbitmq_user:
user: "{{ magnum_rabbitmq_userid }}"
password: "{{ magnum_rabbitmq_password }}"
vhost: "{{ magnum_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- magnum-rabbitmq
- magnum-rabbitmq-user
- name: Create Magnum's database tables
mysql_db:
login_user: "{{ galera_root_user }}"
@ -72,15 +103,6 @@
- magnum-database-setup
- magnum-db-setup
- magnum-setup
- name: Sort the rabbitmq servers
dist_sort:
value_to_lookup: "{{ container_name }}"
ref_list: "{{ groups['magnum_all'] }}"
src_list: "{{ rabbitmq_servers }}"
register: servers
- name: Set rabbitmq servers
set_fact:
rabbitmq_servers: "{{ servers.sorted_list }}"
- name: Create log dir
file:
path: "/openstack/log/{{ inventory_hostname }}-magnum"
@ -110,9 +132,10 @@
- "system-crontab-coordination"
vars:
galera_address: "{{ internal_lb_vip_address }}"
magnum_galera_address: "{{ internal_lb_vip_address }}"
magnum_galera_database_name: magnum_service
magnum_galera_user: magnum
magnum_rabbitmq_userid: magnum
magnum_rabbitmq_vhost: /magnum
ansible_hostname: "{{ container_name }}"
is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -25,10 +25,6 @@
- include: pre-install.yml
- include: messaging-setup.yml
when: >
inventory_hostname == groups['magnum_all'][0]
- include: install.yml
- include: post-install.yml

View File

@ -1,38 +0,0 @@
---
# Copyright 2016, Ian Cordasco
#
# 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 the Magnum RabbitMQ virtualhost exists
rabbitmq_vhost:
name: "{{ magnum_rabbitmq_virtualhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- magnum-rabbitmq
- magnum-rabbitmq-vhost
- magnum-rabbitmq-virtualhost
- name: Ensure the Magnum RabbitMQ user exists
rabbitmq_user:
user: "{{ magnum_rabbitmq_userid }}"
password: "{{ magnum_rabbitmq_password }}"
vhost: "{{ magnum_rabbitmq_virtualhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
tags:
- magnum-rabbitmq
- magnum-rabbitmq-user