From be3b61e8e4f307874edb94931884b0cd47e305a4 Mon Sep 17 00:00:00 2001 From: VC Date: Fri, 5 Jul 2024 11:53:33 +0200 Subject: [PATCH] fix: script rewrite & shell command --- roles/restic/tasks/install.yml | 2 +- roles/restic/templates/resticbackup.sh.j2 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/restic/tasks/install.yml b/roles/restic/tasks/install.yml index 308334e..e153cf8 100644 --- a/roles/restic/tasks/install.yml +++ b/roles/restic/tasks/install.yml @@ -7,7 +7,7 @@ mode: 0644 - name: Uncompress restic - ansible.builtin.command: + ansible.builtin.shell: cmd: "bzip2 -dc /tmp/restic_{{ restic_version }}_{{ restic_system }}_{{ restic_architecture }}.bz2 > {{ restic_path }}" changed_when: true diff --git a/roles/restic/templates/resticbackup.sh.j2 b/roles/restic/templates/resticbackup.sh.j2 index df715f4..83785c1 100644 --- a/roles/restic/templates/resticbackup.sh.j2 +++ b/roles/restic/templates/resticbackup.sh.j2 @@ -1,10 +1,10 @@ #!/bin/sh ## Variable -RESTIC_PASSWORD="{{ restic_pass }}" -RESTIC_REPOSITORY="{{ restic_repository }}" -AWS_ACCESS_KEY_ID="{{ restic_aws_access_key_id }}" -AWS_SECRET_ACCESS_KEY="{{ restic_aws_secret_access_key }}" +export RESTIC_PASSWORD="{{ restic_pass }}" +export RESTIC_REPOSITORY="{{ restic_repository }}" +export AWS_ACCESS_KEY_ID="{{ restic_aws_access_key_id }}" +export AWS_SECRET_ACCESS_KEY="{{ restic_aws_secret_access_key }}" ## lancement de la sauvegarde {{ restic_path }} backup --exclude-caches {% for i in restic_backup_excluded_path %} -e {{ i }} {% endfor %} {% for i in restic_backup_path %}{{ i }} {% endfor %}