Skip to content

use backports on debian 11 for package install #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ borgmatic_timer_hour: "{{ range(0, 5) | random(seed=inventory_hostname) }}"
borgmatic_timer_minute: "{{ range(0, 59) | random(seed=inventory_hostname) }}"
borg_install_method: "pip"
borg_require_epel: "{{ ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora' }}"
borg_require_backports: "{{ ansible_distribution == 'Debian' and ansible_distribution_major_version == '11' }}"

borgmatic_config_name: config.yaml
borgmatic_hooks:
Expand Down
10 changes: 9 additions & 1 deletion tasks/noauto_install_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@
- "'epel-release' in ansible_facts.packages"
fail_msg: Need EPEL repo to install via distro package.

- name: Check if backports repo is enabled, if installation from distro is requested
when: borg_require_backports
ansible.builtin.apt_repository:
repo: "deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main"
state: present
register: __borg_require_backports

- name: Install borgmatic and borg via distribution package manager
ansible.builtin.package:
name: "{{ item }}"
state: present
state: "{{ __borg_require_backports.changed | ternary('latest', 'present') }}"
default_release: "{{ borg_require_backports | ternary(ansible_distribution_release + '-backports', omit) }}"
loop: "{{ borg_distro_packages }}"
...