Skip to content

Commit 373a242

Browse files
committed
nixos/rabbitmq: install rabbitmqadmin-ng by default
FC-43451 This uses the HTTP API from RabbitMQ for administrative purposes and looks quite useful so far. Since it took me a moment to figure out how to configure a user that can interact with this tool, I added the setup part to our manual.
1 parent 2412d64 commit 373a242

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
3+
A new changelog entry.
4+
5+
Delete placeholder items that do not apply. Empty sections will be removed
6+
automatically during release.
7+
8+
Leave the XX.XX as is: this is a placeholder and will be automatically filled
9+
correctly during the release and helps when backporting over multiple platform
10+
branches.
11+
12+
-->
13+
14+
### Impact
15+
16+
- [`rabbitmqadmin-ng`](https://www.rabbitmq.com/docs/management-cli) is now installed by default on machines with
17+
the `rabbitmq` role.
18+
19+
### NixOS XX.XX platform

doc/src/rabbitmq.md

+22
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ We remove the guest user for security reasons.
1818
Service users can access the rabbitmq account with {command}`sudo -iu rabbitmq`
1919
to perform administrative tasks with {command}`rabbitmqctl`.
2020

21+
Alternatively, [`rabbitmqadmin-ng`](https://www.rabbitmq.com/docs/management-cli) may be used
22+
to interact with the HTTP API. It is installed by default with the `rabbitmq` role.
23+
24+
For this to work, a `~/.rabbitmqadmin.conf` is required with a configuration like this:
25+
26+
```toml
27+
[default]
28+
hostname = "localhost"
29+
port = 15672
30+
username = "myusername"
31+
password = "mypassword"
32+
vhost = '/'
33+
```
34+
35+
For this, you need a user `myusername` in RabbitMQ with the tags
36+
`administrator` & `management`. Such a user can be created like this:
37+
38+
```
39+
rabbitmqctl add_user myusername mypassword
40+
rabbitmqctl set_user_tags myusername management administrator
41+
```
42+
2143
## Monitoring
2244

2345
The default monitoring setup checks that the RabbitMQ server is healthy and responding to AMQP connections.

nixos/services/rabbitmq/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ in {
142142
config = mkIf cfg.enable {
143143

144144
# This is needed so we will have 'rabbitmqctl' in our PATH
145-
environment.systemPackages = [ cfg.package ];
145+
environment.systemPackages = [ cfg.package pkgs.rabbitmqadmin-ng ];
146146
environment.etc."local/rabbitmq/README.txt".text = ''
147147
RabbitMQ (${cfg.package.version}) is running on this machine.
148148

0 commit comments

Comments
 (0)