MXS-1464 Add config 'substitute_variables'

With this variables set to true, if $VAR is used as a value in the
configuration file, then `$VAR` will be replaced with the value of
the environment variable VAR.
This commit is contained in:
Johan Wikman
2017-10-09 12:29:52 +03:00
parent 2534c9b824
commit 1666c9f0b6
4 changed files with 52 additions and 2 deletions

View File

@ -561,6 +561,32 @@ This will log all statements that cannot be parsed completely. This may be
useful if you suspect that MariaDB MaxScale routes statements to the wrong
server (e.g. to a slave instead of to a master).
#### `substitute_variables`
Enable or disable the substitution of environment variables in the MaxScale
configuration file. If the substitution of variables is enabled and a
configuration line like
```
some_parameter=$SOME_VALUE
```
is encountered, then `$SOME_VALUE` will be replaced with the actual value
of the environment variable `SOME_VALUE`. Note:
* Variable substitution will be made _only_ if '$' is the first character
of the value.
* _Everything_ following '$' is interpreted as the name of the environment
variable.
* Referring to a non-existing environment variable is a fatal error.
By default, the value of `substitute_variables` is `false`.
```
substitute_variables=true
```
The setting of `substitute_variables` will have an effect on all parameters
in the all other sections, irrespective of where the `[maxscale]` section
is placed in the configuration file. However, in the `[maxscale]` section,
to ensure that substitution will take place, place the
`substitute_variables=true` line first.
### REST API Configuration
The MaxScale REST API is an HTTP interface that provides JSON format data