restic version from pillar

This commit is contained in:
Keiran Snowden
2023-11-27 19:51:17 -05:00
parent 1f89c93f30
commit 99efec7e95
3 changed files with 5 additions and 10 deletions

View File

@@ -1,12 +1,8 @@
#!/bin/bash
{% set arch = 'arm' salt.grains.get(cpuarch).startswith('arm') else 'amd64' %}
{% set restic_version = salt.pillar.get("restic:version") %}
if test -z "$RESTIC_VERSION"; then
echo "RESTIC_VERSION is not defined"
exit 1
fi
URL="https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_{{ arch }}.bz2"
URL="https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_{{ arch }}.bz2"
wget --quiet "${URL}" -O - | bzip2 -cd > /bin/restic.tmp
if [ $? -eq 0 ]; then