A fully managed platform to automate infrastructure on any cloud with HashiCorp products. Two approaches to injecting variability into your Nomad batch job template without having to modify the template in the future.
You can use the UUID function to inject variation and thus ensure the job is unique every time you run the command nomad run.
This will submit the batch job to Nomad: Check the status of the job allocation by using the nomad alloc status command: The output indicates a successful job with an exit code 0.
This batch does the exact same thing as the uuid.nomad file, except this code snippet is using variables: Go ahead and submit the batch job by running the command nomad run -var run_index variable.nomad: Check the status of the job with the nomad alloc status command: The output reveals that the job completed successfully.