[rabbitmq-discuss] rabbitmqadmin and ability to read configuration files

Massimo Paladin Massimo.Paladin at cern.ch
Mon Feb 6 17:09:45 GMT 2012


Hello,

with the intention of using rabbitmqadmin to automate rabbitmq configuration
we had to improve rabbitmqadmin to be able to read configuration files.

Such requirement was needed for different reasons:
- security: it is not very nice to launch commands with passwords in the
command line
- code duplication: previous point would have required to hard-code
username and password
  in rabbitmqadmin which is something we would like to avoid
- it is nice to have a single configuration file containing configuration
for multiple hosts
  and be able to recall that host from the command line

For such reasons I made some small changes to rabbitmqadmin to make it work
with configuration files.
The script doesn't brake backward compatibility.

The modified script:
https://github.com/mpaladin/rabbitmq-custom/blob/master/rabbitmqadmin/rabbitmqadmin

An example of configuration file:
https://github.com/mpaladin/rabbitmq-custom/blob/master/rabbitmqadmin/rabbitmqadmin.conf.example

To profit from the configuration file just run:
# rabbitmqadmin -c rabbitmqadmin.conf.example -N host_normal ...

Hopefully someone will benefit from this change and it would be nice to see
it in the next release.

The changes reflect this behavior:
- there are hard-coded default values (like before)
- eventual configuration file setting override the defaults
- command line override the result of the previous steps

Cheers,
---
Massimo Paladin

email: massimo.paladin at gmail.com
website: http://www.mpaladin.com
flickr's page: http://flickr.com/photos/massimop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120206/951c60b6/attachment.htm>


More information about the rabbitmq-discuss mailing list