Remove cluster formation configuration from rabbitmq.config. Cluster formation is managed by the task files in the role, see tasks/rabbitmq_cluster.yml for details. The entries in the config template are unnecessary and I believe they may be causing clustering failures when the clustering tasks run. Remove testing for cluster configuration in rabbitmq.config. Change-Id: Ia65da05a5c967965143e8167657688d6906ad1f0
61 lines
2.4 KiB
YAML
61 lines
2.4 KiB
YAML
---
|
|
# Copyright 2015, 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: Check rabbitmq is running
|
|
command: "pgrep rabbit"
|
|
delegate_to: "{{ item }}"
|
|
when: ansible_ssh_host == item
|
|
with_items:
|
|
- 10.100.100.101
|
|
- 10.100.100.102
|
|
- 10.100.100.103
|
|
- name: Open rabbitmq.config
|
|
slurp:
|
|
src: "/etc/rabbitmq/rabbitmq.config"
|
|
register: rabbitmq_config
|
|
- name: Open enabled_plugins
|
|
slurp:
|
|
src: "/etc/rabbitmq/enabled_plugins"
|
|
register: enabled_plugins
|
|
- name: Read rabbitmq_ssl_cert
|
|
stat:
|
|
path: "{{ rabbitmq_ssl_cert }}"
|
|
register: rabbitmq_ssl_cert_stat
|
|
- name: Read rabbitmq_ssl_key
|
|
stat:
|
|
path: "{{ rabbitmq_ssl_key }}"
|
|
register: rabbitmq_ssl_key_stat
|
|
- name: Read rabbit files
|
|
set_fact:
|
|
enabled_plugins_contents: "{{ enabled_plugins.content | b64decode }}"
|
|
rabbitmq_config_contents: "{{ rabbitmq_config.content | b64decode }}"
|
|
rabbitmq_ssl_cert_checksum: "{{ rabbitmq_ssl_cert_stat.stat.checksum }}"
|
|
rabbitmq_ssl_key_checksum: "{{ rabbitmq_ssl_key_stat.stat.checksum }}"
|
|
- name: Check files contents
|
|
assert:
|
|
that:
|
|
- "'rabbitmq_management' in enabled_plugins_contents"
|
|
- name: Get status of rabbitmq
|
|
command: rabbitmqctl status
|
|
register: rabbitmqctl_status
|
|
- name: Ensure SSL cert/key checksums are identical across cluster
|
|
assert:
|
|
that:
|
|
- hostvars['container1']['rabbitmq_ssl_cert_checksum'] == hostvars['container2']['rabbitmq_ssl_cert_checksum'] == hostvars['container3']['rabbitmq_ssl_cert_checksum']
|
|
- hostvars['container1']['rabbitmq_ssl_key_checksum'] == hostvars['container2']['rabbitmq_ssl_key_checksum'] == hostvars['container3']['rabbitmq_ssl_key_checksum']
|
|
- name: Ensure expected version of rabbitmq is running
|
|
assert:
|
|
that: rabbitmqctl_status.stdout | search ("rabbit,\"RabbitMQ\",\"{{ rabbitmq_package_version.split('-')[0] }}\"")
|