NB5 Docs► Reference Section► Workload Specification▼ Template Variables 🖺

Template Variables

Template variables allow for workload descriptions to be parameterized outside the structure of the templating language.

Template variables are resolved in the workload after the on-disk format is loaded and before yaml parsing.

call form with defaults

This is the preferred form. It's easier on syntax checkers.

yaml:

name: TEMPLATE(myname,thedefault)

json:


{
    "name": "thedefault"
}

ops:


[]

call form with no default, requires input

yaml:

name: TEMPLATE(myname)

json:


{
    "name": "UNSET:myname"
}

ops:


[]

call form with null default

yaml:

name: TEMPLATE(myname,)

json:


{
    "name": null
}

ops:


[]

call form with default value specified once

yaml:

name: TEMPLATE(myname,default)
description: This is the description for name 'TEMPLATE(myname)'

json:


{
    "name": default,
    "description": "This is the description for name 'default'"
}

ops:


[]

angle bracket value with defaults

This form is deprecated! It conflicts with the YAML syntax for anchors and aliases. It will be removed in the next major version.

yaml:

name: <<myname,thedefault>>
desc: <<mydesc:mydescription>>

json:


{
    "name": "thedefault",
    "desc": "mydescription"
}

ops:


[]