Variables

User Defined Variables

User-defined variables can be created through the web interface. These variables are then made available for use in both job and volume templates.

To use a user-defined variable, for example myvariable, it must be prefixed with .var.. Therefore, the correct usage within a template would be ${{ .var.myvariable }}.

When creating or editing a variable the Protected option can be selected. If a variable is marked as protected then when editing the variable the value isn’t loaded back into the browser.

⚠️
Protected variables are stored encrypted in the database but are decrypted before being used in templates therefore their values may be exposed within the Nomad job definitions.

System Variables

System variables are accessible for both job templates and volume templates.

To make use of a system variable it simply needs to specified, for example, ${{ .space.name }}.

Available Variables

GroupNameDescription
space
space.idThe UUID of the space
space.nameThe name of the space
template
template.idThe UUID of the template used to create the space
template.nameThe name of the template used to create the space
user
user.idThe UUID of the user running the space
user.timezoneThe timzone of the user
user.usernameThe username of the user running the space
user.emailThe users email address
user.service_passwordService password for the user
server
server.urlThe URL of the knot server
server.agent_urlThe URL of the knot server that agents should use
server.wildcard_domainThe wildcard domain without the leading *
server.locationThe server location string
nomad
nomad.dcThe nomad datacenter the server is running in, read from the environment variable NOMAD_DC
nomad.regionThe nomad region the server is running in, read from the environment variable NOMAD_REGION