# 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 "{{os_refresh_config_folder}}/post-configure.d/"|grep '\-rabbitmq$' register: test_rabbitmq_script_list when: rabbit_cluster_test.rc == 0 - name: If node rabbitmq cluster config was present, prevent os-refresh-config post-configure.d job from executing. file: mode=0644 path="{{os_refresh_config_folder}}/post-configure.d/{{item}}" when: rabbit_cluster_test.rc == 0 with_items: test_rabbitmq_script_list.stdout_lines