job "vault-cluster-nomad" { datacenters = ["dc1"] type = "service" group "vault-ch4" { count = 1 constraint { attribute = "${node.unique.name}" operator = "=" value = "ch4" } network { port "http" { static = 8200 to = 8200 } } task "vault" { driver = "exec" consul { namespace = "default" } resources { cpu = 500 memory = 1024 } env { VAULT_ADDR = "http://127.0.0.1:8200" } # 从 consul 读取配置 template { data = <