Allow users to use rabbitmqctl

RabbitMQ is our message queue of choice for Celery. One of its main commands is rabbitmqctl; it lets you manage your rabbit nodes. The command itself is just a shell script that uses sudo -u rabbitmq to run an the Erlang rabbitmqctl program. It has to use sudo so that can it run as the rabbitmq user to use the same Erlang cookie that the broker is running with.

If you want to allow more than root or wheel group members to use the command, just use this sudoers privilege specification:

ALL=(rabbitmq) SETENV: NOPASSWD: /usr/local/bin/erl

(rabbitmq) assumes your RabbitMQ broker runs as the ‘rabbitmq’ user. It also assume you have Erlang installed in /usr/local