Nomad multiple task

Hello.
I want to create a multiple task using json var-file.
My json var-file:


    "tasks": [
      {
        "task_name": "first-task-name",
        "config": {
          "image": "test"
        },
        "service": {
          "service_name": "first-service-name"
        },
        "resources": {
          "cpu": 100,
          "memory": 256
        }
      },
      {
        "task_name": "second-task-name",
        "config": {
          "image": "test"
        },
        "service": {
          "service_name": "second-service-name"
        },
        "resources": {
          "cpu": 100,
          "memory": 256
        }
      }
    ]

And in a nomad.job file I use variables from json var-file:

    task "[[ .job.tasks.task_name ]]" {
      driver = "docker"

      config {
        image = "[[ .job.tasks.config.image ]]:[[ env "IMAGE_TAG" ]]"
        ports = ["https"]

But I’m getting an error:
executing "jobTemplate" at <.job.tasks.task_name>: can't evaluate field task_name in type interface {}

Please help me to understand where is a mistake.
Thank you.

Hi @perrfect,

Could you please provide the command you are running when rendering the job specification template?

Thanks,
jrasell and the Nomad team

Any ideas?
Maybe a problem is in my json var-file?

levant plan -log-level=debug -var-file=vars.json -address='${env.NOMAD_URL}' nomad.job

levant deploy -log-level=debug -var-file=vars.json -address='${env.NOMAD_URL}' nomad.job