Command: var
The var
command is used to interact with Nomad variables.
Usage
Usage: nomad var <subcommand> [options] [args]
Run nomad var <subcommand> -h
for help on that subcommand. The following
subcommands are available:
var init
- Create a variable specification filevar list
- List variables the user has access tovar get
- Retrieve a variablevar put
- Insert or update a variablevar purge
- Permanently delete a variable
Examples
Create or update the variable stored at the path "secret/creds", which contains
an item named passcode
with the value my-long-passcode
.
$ nomad var put -out=table secret/creds passcode=my-long-passcodeSuccessfully created variable "secret/creds"! Namespace = defaultPath = secret/credsCreate Time = 2022-08-23T11:14:37-04:00Check Index = 116 Itemspasscode = my-long-passcode
Update a value:
$ nomad var get secret/creds | nomad var put -in=json -out=table -v - user=dbaReading whole JSON variable specification from stdinSuccessfully updated variable "secret/creds"! Namespace = defaultPath = secret/credsCreate Time = 2022-08-23T11:14:37-04:00Check Index = 116 Itemspasscode = my-long-passcodeuser = dba