✨ add support for debian 13 trixie
This commit is contained in:
parent
7fa4e25670
commit
d881ab0eba
4 changed files with 41 additions and 15 deletions
5
tasks/debian-12-or-earlier.yml
Normal file
5
tasks/debian-12-or-earlier.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: install backports apt list
|
||||
template:
|
||||
src: backports.list.j2
|
||||
dest: /etc/apt/sources.list.d/backports.list
|
||||
# do this from a template to fully remove any other lines in the file.
|
15
tasks/debian-13-or-later.yml
Normal file
15
tasks/debian-13-or-later.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- name: add backports apt repo
|
||||
deb822_repository:
|
||||
name: backports
|
||||
types:
|
||||
- deb
|
||||
- deb-src
|
||||
uris: http://deb.debian.org/debian/
|
||||
suites: "{{ ansible_distribution_release }}-backports"
|
||||
components:
|
||||
- main
|
||||
- contrib
|
||||
- non-free
|
||||
- non-free-firmware
|
||||
signed_by: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
|
@ -1,20 +1,13 @@
|
|||
- name: install backports apt list
|
||||
template:
|
||||
src: backports.list.j2
|
||||
dest: /etc/apt/sources.list.d/backports.list
|
||||
# do this from a template to fully remove any other lines in the file.
|
||||
- fail:
|
||||
msg: "only supported on debian"
|
||||
when: not ansible_distribution in ["Debian"]
|
||||
|
||||
|
||||
- name: remove obsolete apt lists
|
||||
file: path=/etc/apt/sources.list.d/{{ item }}-backports.list state=absent
|
||||
with_items:
|
||||
- jessie
|
||||
- stretch
|
||||
- name: remove obsolete apt list entries
|
||||
lineinfile: path=/etc/apt/sources.list regexp="{{ item }}-backports" state=absent
|
||||
with_items:
|
||||
- jessie
|
||||
- stretch
|
||||
- include_tasks: remove-obsolete-apt-lists.yml
|
||||
- include_tasks: debian-12-or-earlier.yml
|
||||
when: ansible_distribution_major_version|int <= 12
|
||||
- include_tasks: debian-13-or-later.yml
|
||||
when: ansible_distribution_major_version|int >= 13
|
||||
|
||||
|
||||
- name: update apt cache
|
||||
|
|
13
tasks/remove-obsolete-apt-lists.yml
Normal file
13
tasks/remove-obsolete-apt-lists.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
- name: remove obsolete apt lists
|
||||
file: path=/etc/apt/sources.list.d/{{ item }}-backports.list state=absent
|
||||
with_items:
|
||||
- jessie
|
||||
- stretch
|
||||
- name: remove obsolete apt list entries
|
||||
lineinfile: path=/etc/apt/sources.list regexp="{{ item }}-backports" state=absent
|
||||
with_items:
|
||||
- jessie
|
||||
- stretch
|
||||
- name: remove obsolete backports.list
|
||||
file: path=/etc/apt/sources.list.d/backports.list state=absent
|
||||
when: ansible_distribution_major_version|int >= 13
|
Loading…
Add table
Add a link
Reference in a new issue