Allow setting borg/borgmatic version (#107)

This commit is contained in:
Sébastien Clément 2022-11-22 20:54:31 +01:00 committed by GitHub
parent e1ba1d1364
commit e34f9311d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -85,6 +85,8 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl
- `borgmatic_store_atime`: Store atime into archive. Defaults to `true`
- `borgmatic_store_ctime`: Store ctime into archive. Defaults to `true`
- `ssh_key_file`: Path to a private ssh key file (default is `.ssh/id_ed25519`). It generates a ed25519 key if the file doesn't exist yet.
- `borg_version`: Force a specific borg version to be installed
- `borgmatic_version`: Force a specific borgmatic version to be installed
## Contributing

View File

@ -35,3 +35,7 @@ borgmatic_cron_minute: "{{ 59 | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_day: "{{ range(1, 28) | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_hour: "{{ range(9, 24) | random(seed=inventory_hostname) }}"
borgmatic_cron_checks_minute: "{{ 59 | random(seed=inventory_hostname) }}"
borg_version: false
borgmatic_version: false

View File

@ -17,7 +17,7 @@
- "{{ ansible_lsb.id }}.yml"
- name: Run OS-specific tasks
include: "{{ item }}"
include_tasks: "{{ item }}"
with_first_found:
- "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml"
@ -44,9 +44,11 @@
- name: Install main Python Packages
pip:
name: "{{ borg_python_packages }}"
name: "{{ item.name }}"
version: "{{ item.version | default(omit, true) }}"
virtualenv: /opt/borgmatic
when: borg_python_packages is defined
loop: "{{ borg_python_packages }}"
- name: Create borgmatic command in /usr/local/bin
copy:

View File

@ -3,5 +3,7 @@ borg_dependent_python_packages:
- cython
- pkgconfig
borg_python_packages:
- borgbackup
- borgmatic
- name: borgbackup
version: "{{ borg_version }}"
- name: borgmatic
version: "{{ borgmatic_version }}"