according to release notes for nomad 1.0
we can use variables in agent config fies, but whats the syntax?
in each instance below I get:
data-dir must be given as an absolute path: got ${var.DATA_DIR} Configuration is invalid
data_dir = "${var.DATA_DIR}"
data_dir = ${var.DATA_DIR}
data_dir = $DATA_DIR
lol and etc
i have a data.inputs.hcl
file with content like
variable "BIND_ADDR" {
type = string
default = "0.0.0.0"
}
runeron
December 21, 2022, 9:30pm
3
Since you mentioned Levant, I’d check out this topic:
I am wondering about the future of Nomad Pack vs Levant for templating jobs.
As a Levant user is that it appears that development of Levant has slowed down considerably while nomad pack is the newer method similar to things like helm.
Is Levant planned to no longer be supported and eventually sunset for nomad pack? I just want to know if we should be getting ahead of this change and working towards this goal.
total noob to nomad, thanks,
looks like my next post will be switching to nomad pack
1 Like
runeron
December 22, 2022, 11:14am
5
Just so you’re not confused:
nomad-pack and levant are tools for rendering jobfiles (somewhat similar to helm-charts for kubernetes).
Your initial example (and release note) is related to the nomad agent config , which is not the same
haha yea i figured that out at the end, wont publicly admit how long that took me…
but I ended up dropping both, felt uncomfortable using levant since future development is questionable, and nomad-pack didnt work after a few minutes (took me hours with levant (that agent vs jobspec file thing), so was frustrated)
i’m pretty comfortable with HCL so went with this setup
i couldnt get the simple_service nomad pack to work with docker compose convert
for some reason levant wouldnt consume the compose export as json nor yaml
complained about the volume syntax in both
docker compose convert | yq -r -o=json >.env.${ENV}.compose.json
docker compose convert >.env.${ENV}.compose.yaml
which looks like this for my vault setup
volumes:
- type: bind
source: /home/poop/git/private/nirv/core/apps/nirvai-core-vault/src/config
target: /vault/config
bind:
create_host_path: true
- type: bind
source: /home/poop/git/private/nirv/core/apps/nirvai-core-vault/src/data
target: /vault/data
bind:
create_host_path: true
- type: bind
source: /home/poop/git/private/nirv/core/apps/nirvai-core-letsencrypt/dev-nirv-ai
target: /etc/ssl/certs/dev-nirv-ai
bind:
create_host_path: true