restic version from pillar
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -26,9 +26,7 @@ restic-{{ name }}:
|
||||
- shell: /bin/bash
|
||||
- source: 'salt://restic/files/install.sh'
|
||||
- template: jinja
|
||||
- unless: "/bin/restic version | grep 'restic 0.16.2 '"
|
||||
- env:
|
||||
- RESTIC_VERSION: 0.16.2
|
||||
- unless: "/bin/restic version | grep 'restic {{ salt.pillar.get("restic:version") }} '"
|
||||
{% endif %}
|
||||
|
||||
/etc/logrotate.d/restic-backup:
|
||||
|
||||
Reference in New Issue
Block a user