Constraints in Nomad Pack

To run Traefik on a specific Nomad client using Nomad Pack, I have used:

constraints = [
  {
    attribute = "${node.unique.name}", 
    value = "ip-10-0-1-152",
  }
]

but I get this error message:

Error:   Variables may not be used here.

I was wondering if you know how to do it or if you know of an example.

Is this from the current community traefik pack or your own?

Can you post a link to your repo or the full pack template you are writing?

This is based on the community traefik pack but in order to use the dnsChallenge, I had to modify it.

I found the answer to my question. I needed to use:

‍‍

constraints = [
  {
    attribute = "$${node.unique.name}", 
    value = "ip-10-0-1-152",
  }
]

Hahaha great! I was testing exactly that out myself over here!

1 Like