Load additional Cuttlefish configuration files#2258
Conversation
|
Before marking this patch ready for review, I would love to get feedback on the behavior and the variable name. |
911dc11 to
d424977
Compare
|
I'm sure I've seen this feature requested before. Nice work @dumbbell |
d424977 to
a3764e5
Compare
|
Thanks! |
|
I'm going to add a testcase before we merge it. |
a3764e5 to
8043cd0
Compare
|
I can't add a testsuite because our framework extension, rabbitmq-ct-helpers, already uses an Erlang-term-based configuration file to configure nodes and it can't be modified without a heavy redesign of our testsuites. Therefore, the additional configuration files added by a testcase would be ignored anyway because of the main configuration file format. Let's continue without a testcase for this :-( |
It was already loaded in `rabbit_prelaunch` (prelaunch phase 1).
We already try both formats when we parse the configuration.
By default, in addition to `$RABBITMQ_CONFIG_FILE`, we also load all matching `$RABBITMQ_CONFIG_FILES`. It allows to split the configuration into many files for easier management. Here is the behavior in more details: * If `$RABBITMQ_CONFIG_FILES` is a directory, all files directly inside it are considered. * If `$RABBITMQ_CONFIG_FILES` is a glob pattern, all files matching the pattern are considered. * In both cases, subdirectories (and whatever they contain) are ignored. * `$RABBITMQ_CONFIG_FILES` is only relevant when the main configuration is either missing (the file does not exist or is empty) or uses the Cuttlefish format. * Additional configuration files must use the Cuttlefish format. The default value of `$RABBITMQ_CONFIG_FILES` is: * `/etc/rabbitmq/conf.d/*.conf` on Unix * `%APPDATA%\RabbitMQ\conf.d\*.conf` on Windows Error messages related to Cuttlefish parsing were improved in the process. [#171491267]
8043cd0 to
c1e891c
Compare
|
To make use of To improve this, we can probably always take the Cuttlefish code path: if |
|
FTR, this change first shipped in |
By default, in addition to
$RABBITMQ_CONFIG_FILE, we also load all matching$RABBITMQ_CONFIG_FILES. It allows to split the configuration into many files for easier management.Here is the behavior in more details:
If
$RABBITMQ_CONFIG_FILESis a directory, all files directly inside it are considered.If
$RABBITMQ_CONFIG_FILESis a glob pattern, all files matching the pattern are considered.$RABBITMQ_CONFIG_FILESis only relevant when the main configuration is either missing (the file does not exist or is empty) or uses the Cuttlefish format.The default value of
$RABBITMQ_CONFIG_FILESis:/etc/rabbitmq/conf.d/*.confon Unix%APPDATA%\RabbitMQ\conf.d\*.confon WindowsCAUTION: If we want to backport this feature, we have to backport #2180 first! The reason is that to make this possible, we have to use the Cuttlefish library, not the executable.
Depends on rabbitmq/rabbitmq-common#357.