tripleo-ansible/playbooks/cleanup_rabbitmq_start.yml
Julia Kreger 997f5330d8 RabbitMQ conditional fix
Fixed conditional where a value could be tested that did not
exist because of the value in the conditional.

Duplicated the RabbitMQ cluster variable to prevent the conditional
test from failing from the playbook being resumed from a particular
point after the value is first collected.

Change-Id: I7e162c4dbdef8f2ae5e210a2aef6666e1e3e56b6
2014-11-19 16:49:12 -05:00

32 lines
1.5 KiB
YAML

# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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: Determine if node is part of a cluster
shell: grep -q "$(hostname)" "/mnt/state/var/lib/rabbitmq/mnesia/rabbit@$(hostname)/cluster_nodes.config"
ignore_errors: yes
register: rabbit_cluster_test
- name: Collect names of post-configure.d rabbitmq files
shell: ls /opt/stack/os-config-refresh/post-configure.d/|grep '\-rabbitmq$'
register: test_rabbitmq_script_list
when: single_controller is not defined and rabbit_cluster_test.rc == 0
- name: If node rabbitmq cluster config was present, re-enable os-refresh-config post-configure.d.
sudo: yes
file: mode=0755 path="/opt/stack/os-config-refresh/post-configure.d/{{item}}"
when: single_controller is not defined and rabbit_cluster_test.rc == 0
with_items: test_rabbitmq_script_list.stdout_lines
- name: "Removing temporary rabbitmq-server override"
sudo: yes
file: path=/etc/init/rabbitmq-server.override state=absent