ansible-role-rabbitmq icon indicating copy to clipboard operation
ansible-role-rabbitmq copied to clipboard

Error in check mode on cluster slave node

Open lurkie opened this issue 7 years ago • 1 comments

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.

lurkie avatar Mar 29 '17 13:03 lurkie

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

lurkie avatar Nov 30 '17 10:11 lurkie