apt: migrate apt_repository to deb822_repository

apt_repository is deprecated in favor of deb822_repository and will be
removed in ansible-core 2.25. Convert all six call sites (jitsimeet,
tailscale, mongodb/omada, php-sury/nextcloud, yarn/nodejs/mastodon),
install python3-debian as a dependency where required, remove the legacy
.list files so repositories are not duplicated, and update the apt cache
explicitly where deb822_repository no longer does it.

Also replace the remaining bare ansible_lsb.codename with
ansible_facts['distribution_release'] in the mastodon role.
This commit is contained in:
rene committed 2026-10-22 19:21:09 +02:00
1 parent 4f1f9026d6
commit 74140629f3
5 files changed
+124 -34

No files matched your search

@@ -6,6 +6,7 @@
- apt-transport-https
- software-properties-common
- lsb-release
- python3-debian # Benötigt für deb822_repository
when: ansible_facts['distribution'] in ["Debian", "Ubuntu", "Linux Mint"]
- name: webservers | nextcloud | prereq | get php repo key
@@ -14,14 +15,23 @@
dest: "/usr/share/keyrings/php-sury.gpg"
mode: '0644'
- name: webservers | nextcloud | prereq | remove legacy php repo file
ansible.builtin.file:
path: /etc/apt/sources.list.d/php-sury.list
state: absent
- name: webservers | nextcloud | prereq | add php repo
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/php-sury.gpg] https://packages.sury.org/php/ {{ ansible_facts['distribution_release'] | lower }} main"
state: present
filename: php-sury
update_cache: true
ansible.builtin.deb822_repository:
name: php-sury
types: deb
uris: "https://packages.sury.org/php/"
suites: "{{ ansible_facts['distribution_release'] | lower }}"
components:
- main
signed_by: /usr/share/keyrings/php-sury.gpg
- name: webservers | nextcloud | prereq | install php
ansible.builtin.package:
ansible.builtin.apt:
state: latest
update_cache: true
name: "{{ nextcloud_php_packages | map(attribute='package') | list }}"