19 lines
516 B
Plaintext
Raw Normal View History

2022-08-02 18:00:20 +02:00
#!/bin/sh
set -eo pipefail
2023-07-26 19:00:19 +02:00
{% if nomad_conf.server.enabled %}
if [ -e /etc/profile.d/vault.sh ]; then
source /etc/profile.d/vault.sh
fi
if [ -e /etc/profile.d/nomad.sh ]; then
source /etc/profile.d/nomad.sh
fi
{% if nomad_conf.acl.enabled and nomad_backup_token is defined %}
export NOMAD_TOKEN={{ nomad_backup_token }}
2024-10-24 12:00:41 +02:00
# Give some time for the token to be replicated (if obtained from vault)
sleep 0.1
2022-09-02 18:00:22 +02:00
{% endif %}
2023-07-26 19:00:19 +02:00
{% endif %}
/usr/local/bin/nomad operator snapshot save {{ nomad_root_dir }}/backup/nomad.snap