mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-12 00:03:17 +02:00
18 lines
538 B
Django/Jinja
18 lines
538 B
Django/Jinja
#!/bin/sh
|
|
|
|
set -eo pipefail
|
|
{% if consul_conf.server %}
|
|
if [ -e /etc/profile.d/vault.sh ]; then
|
|
source /etc/profile.d/vault.sh
|
|
fi
|
|
if [ -e /etc/profile.d/consul.sh ]; then
|
|
source /etc/profile.d/consul.sh
|
|
fi
|
|
{% if consul_conf.acl.enabled and consul_backup_token is defined %}
|
|
export CONSUL_HTTP_TOKEN={{ consul_backup_token }}
|
|
# Give some time for the token to be replicated (if obtained from vault)
|
|
sleep 0.1
|
|
{% endif %}
|
|
{% endif %}
|
|
consul snapshot save -append-filename version,dc,node,status {{ consul_root_dir }}/backup/consul.snap
|