apt: with Debian, 12 backports are installed but disabled by default

This commit is contained in:
Jérémy Lecour 2023-03-18 15:38:05 +01:00 committed by Jérémy Lecour
parent 512b06a513
commit 6f61a0744c
6 changed files with 11 additions and 11 deletions

View File

@ -15,6 +15,8 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Changed
* apt: with Debian 12, backports are installed but disabled by default
### Fixed
### Removed

View File

@ -8,6 +8,8 @@ apt_upgrade: False
apt_install_basics: True
apt_basics_components: "main"
# With Debian 12+ and the deb822 format of source files
# backports are always installed but enabled according to `apt_install_backports`
apt_install_backports: False
apt_backports_components: "main"

View File

@ -0,0 +1,3 @@
Package: *
Pin: release a=bookworm-backports
Pin-Priority: 50

View File

@ -1,13 +1,6 @@
---
- name: No backports config in default sources.list
lineinfile:
dest: /etc/apt/sources.list.d/
regexp: "backports"
state: absent
tags:
- apt
- name: Backports sources list is installed
- name: Backports deb822 sources list is installed
template:
src: '{{ ansible_distribution_release }}_backports.sources.j2'
dest: /etc/apt/sources.list.d/backports.sources

View File

@ -46,7 +46,6 @@
- apt_install_basics | bool
- ansible_distribution_major_version is version('12', '>=')
- name: Install backports repositories (Debian <12)
import_tasks: backports.oneline.yml
tags:
@ -55,12 +54,13 @@
- apt_install_backports | bool
- ansible_distribution_major_version is version('12', '<')
# With Debian 12+ and the deb822 format of source files
# backports are always installed but enabled according to `apt_install_backports`
- name: Install backports repositories (Debian >=12)
import_tasks: backports.deb822.yml
tags:
- apt
when:
- apt_install_backports | bool
- ansible_distribution_major_version is version('12', '>=')

View File

@ -4,4 +4,4 @@ Types: deb
URIs: http://mirror.evolix.org/debian
Suites: bullseye-backports
Components: {{ apt_backports_components | mandatory }}
Enabled: yes
Enabled: {{ apt_install_backports | bool | ternary('yes', 'no') }}