Variable substitution
You can use the manage-profile
tool to substitute different variables in server profiles.
The manage-profile
tool uses the format ${VARIABLE}
to support the substitution of variables in profiles. This format can be escaped by using another $
. For example, after substitution, $${VARIABLE}
becomes ${VARIABLE}
.
Variable values can be read from a profile variables file or from environment variable values. If both options are used, the values that are specified in the file overwrite any environment variables.
The following code provides an example of how you can set user-defined variables by using a variables file in the server profile.
HOSTNAME=testserver.example.com PORT=389
The following table describes built-in variables that can also be referenced in the server profile. Use these variables in the format previously described.
Built-in variable | Description | ||
---|---|---|---|
|
Evaluates to the absolute path of the server’s root directory |
||
|
Evaluates to the individual profile’s root directory
|
For more information about the tool’s usage, run the command bin/manage-profile --help
.