Use distribution restic

This commit is contained in:
Wojciech Kozlowski 2023-10-01 19:26:59 +02:00
parent f6d22f01da
commit ee760ad143
2 changed files with 4 additions and 29 deletions

View File

@ -207,7 +207,7 @@ class RepoManager(abc.ABC):
aws_bucket_endpoint=self._config["aws_bucket_endpoint"], aws_bucket_endpoint=self._config["aws_bucket_endpoint"],
aws_keys=aws_keys, aws_keys=aws_keys,
restic_cmd_base=[ restic_cmd_base=[
"/usr/local/bin/restic", "/usr/bin/restic",
"--password-file", self._config["restic_password_file"], "--password-file", self._config["restic_password_file"],
"--option", "s3.storage-class=ONEZONE_IA", "--option", "s3.storage-class=ONEZONE_IA",
], ],

View File

@ -1,32 +1,7 @@
--- ---
- name: "check if restic is installed" - name: "install restic"
ansible.builtin.stat: ansible.builtin.apt:
path: "/usr/local/bin/restic" name: "restic"
register: backups_restic_binary_path
- block:
- name: "download restic binary"
ansible.builtin.get_url:
url: "\
https://github.com/restic/restic/releases/download/v0.14.0/restic_0.14.0_linux_amd64.bz2"
dest: "/usr/local/bin/restic.bz2"
mode: 0644
- name: "install bzip2"
ansible.builtin.apt:
name: "bzip2"
- name: "unpack restic binary"
command: "bunzip2 /usr/local/bin/restic.bz2"
when:
not backups_restic_binary_path.stat.exists
- name: "ensure restic is executable"
ansible.builtin.file:
path: "/usr/local/bin/restic"
mode: 0755
- name: "create a cache directory for restic" - name: "create a cache directory for restic"
ansible.builtin.file: ansible.builtin.file: