diff --git a/rpc_deployment/playbooks/monitoring/maas_local.yml b/rpc_deployment/playbooks/monitoring/maas_local.yml index 5ab4693..365bbd1 100644 --- a/rpc_deployment/playbooks/monitoring/maas_local.yml +++ b/rpc_deployment/playbooks/monitoring/maas_local.yml @@ -301,7 +301,7 @@ - hosts: rabbit vars: check_name: rabbitmq_status - check_details: file={{ check_name }}.py,args=-H,args={{ ansible_ssh_host }},args=-n,args={{ inventory_hostname.split('.')[0] }} + check_details: file={{ check_name }}.py,args=-H,args={{ ansible_ssh_host }},args=-n,args={{ inventory_hostname.split('.')[0] }},args=-U,args={{ rabbit_userid }},args=-p,args={{ rabbit_password }} check_period: "{{ maas_check_period }}" check_timeout: "{{ maas_check_timeout }}" alarms: diff --git a/rpc_deployment/roles/rabbit_user/tasks/main.yml b/rpc_deployment/roles/rabbit_user/tasks/main.yml index c55e5cb..5119301 100644 --- a/rpc_deployment/roles/rabbit_user/tasks/main.yml +++ b/rpc_deployment/roles/rabbit_user/tasks/main.yml @@ -26,3 +26,24 @@ - users - rabbit_config - rabbit_user + +# This is being done because the rabbitctl command used by the module +# is not very effective at returning proper status codes for failure +# and the module does not error detection. until we can go upstream +# to fix this issue this task being being done in two parts to ensure +# that the "guest" user is eradicated. +- name: Ensure default rabbitmq guest user is removed + rabbitmq_user: + user: guest + state: absent + when: inventory_hostname == groups['rabbitmq_all'][0] + tags: + - rabbit_user + +- name: Ensure default rabbitmq guest user is removed + rabbitmq_user: + user: guest + state: absent + when: inventory_hostname != groups['rabbitmq_all'][0] + tags: + - rabbit_user