job "vault-cluster-exec" { datacenters = ["dc1"] type = "service" group "vault-ch4" { count = 1 # 使用存在的属性替代consul版本检查 constraint { attribute = "${driver.exec}" operator = "=" value = "1" } constraint { attribute = "${node.unique.name}" value = "ch4" } network { port "api" { static = 8200 } port "cluster" { static = 8201 } } task "vault" { driver = "exec" config { command = "vault" args = [ "server", "-config=/opt/nomad/data/vault/config/vault.hcl" ] } template { data = <