github.com/hernad/nomad@v1.6.112/e2e/consul/input/namespaces/template_kv.nomad (about)

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "template_kv" {
     5    datacenters = ["dc1"]
     6    type        = "batch"
     7  
     8    constraint {
     9      attribute = "${attr.kernel.name}"
    10      value     = "linux"
    11    }
    12  
    13    group "group-b" {
    14  
    15      consul {
    16        namespace = "banana"
    17      }
    18  
    19      task "task-b" {
    20        driver = "raw_exec"
    21  
    22        config {
    23          command = "cat"
    24          args    = ["local/a.txt"]
    25        }
    26  
    27        template {
    28          data        = "value: {{ key \"ns-kv-example\" }}"
    29          destination = "local/a.txt"
    30        }
    31      }
    32    }
    33  
    34    group "group-z" {
    35  
    36      # no consul namespace set
    37  
    38      task "task-z" {
    39        driver = "raw_exec"
    40  
    41        config {
    42          command = "cat"
    43          args    = ["local/a.txt"]
    44        }
    45  
    46        template {
    47          data        = "value: {{ key \"ns-kv-example\" }}"
    48          destination = "local/a.txt"
    49        }
    50      }
    51    }
    52  }