mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-12 00:03:17 +02:00
19 lines
516 B
Django/Jinja
19 lines
516 B
Django/Jinja
#!/bin/sh
|
|
|
|
set -eo pipefail
|
|
|
|
{% 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 }}
|
|
# Give some time for the token to be replicated (if obtained from vault)
|
|
sleep 0.1
|
|
{% endif %}
|
|
{% endif %}
|
|
/usr/local/bin/nomad operator snapshot save {{ nomad_root_dir }}/backup/nomad.snap
|