ansible-role-rabbitmq
ansible-role-rabbitmq copied to clipboard
Error in check mode on cluster slave node
When running in check mode, the task 'ensure rabbitmq cluster member' fails, because variable rabbitmq_output is not available as the rabbitmqctl command from the previous task has not run.
Also, the current tasks will always restart rabbitmq app when Ansible runs.
The following patch resolves my issue
index 6965682..8de5a80 100644
--- a/tasks/cluster.yml
+++ b/tasks/cluster.yml
@@ -10,6 +10,7 @@
- name: ensure rabbitmq cluster member
fail: msg="Unable to join the cluster."
when: ("'already_member' not in rabbitmq_output.stderr") and rabbitmq_output.rc != 0
+ ignore_errors: "{{ ansible_check_mode }}"
- name: start rabbitmq app
shell: rabbitmqctl start_app