Use constraints template
This commit is contained in:
parent
abaf6b57db
commit
026f20b925
|
@ -9,10 +9,7 @@ job "[[ .instance ]]" {
|
|||
count = [[ $c.count ]]
|
||||
shutdown_delay = "10s"
|
||||
|
||||
constraint {
|
||||
operator = "distinct_hosts"
|
||||
value = "true"
|
||||
}
|
||||
[[ template "common/constraints" $c ]]
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
|
|
|
@ -40,6 +40,11 @@ mongo:
|
|||
meta:
|
||||
addr: 'mongo-${NOMAD_ALLOC_INDEX}.[[ .instance ]][[ .consul.suffix ]].service.[[ .consul.domain ]]'
|
||||
|
||||
nomad:
|
||||
constraints:
|
||||
- operator: distinct_hosts
|
||||
value: true
|
||||
|
||||
# If port is set, a static port will be allocated. Else, a dynamic port will be used
|
||||
# port: 27017
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user