Refactor apt-migrate-to-trixie.yml: clean up comments, improve task definitions, and ensure proper permissions for backup files
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
# deb822 ist das neue Konfigurationsformats für APT-Quellen (Repositories).
|
# deb822 ist das neue Konfigurationsformats für APT-Quellen (Repositories).
|
||||||
# Es basiert auf der Debian Control Syntax nach RFC 822 – daher der Name
|
# Es basiert auf der Debian Control Syntax nach RFC 822 – daher der Name
|
||||||
@@ -35,13 +34,12 @@
|
|||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Sicherstellen, dass wir Debian sind
|
- name: Sicherstellen, dass wir Debian sind
|
||||||
assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts['os_family'] == "Debian"
|
- ansible_facts['os_family'] == "Debian"
|
||||||
fail_msg: "Dieses Playbook ist nur für Debian geeignet."
|
fail_msg: "Dieses Playbook ist nur für Debian geeignet."
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: Keyring für Debian-Archive sicherstellen (falls Signed-By genutzt)
|
- name: Keyring für Debian-Archive sicherstellen (falls Signed-By genutzt)
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: debian-archive-keyring
|
name: debian-archive-keyring
|
||||||
@@ -54,7 +52,13 @@
|
|||||||
dest: /etc/apt/sources.list.before-trixie
|
dest: /etc/apt/sources.list.before-trixie
|
||||||
remote_src: true
|
remote_src: true
|
||||||
force: false
|
force: false
|
||||||
ignore_errors: true
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
failed_when:
|
||||||
|
- backup_result.failed
|
||||||
|
- "'No such file or directory' not in backup_result.msg"
|
||||||
|
register: backup_result
|
||||||
|
|
||||||
- name: Alte /etc/apt/sources.list deaktivieren (leere Kommentar-Datei)
|
- name: Alte /etc/apt/sources.list deaktivieren (leere Kommentar-Datei)
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@@ -90,6 +94,7 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
when: enable_backports
|
when: enable_backports
|
||||||
|
|
||||||
- name: Backports-Repo entfernen wenn deaktiviert
|
- name: Backports-Repo entfernen wenn deaktiviert
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /etc/apt/sources.list.d/backports.sources
|
path: /etc/apt/sources.list.d/backports.sources
|
||||||
@@ -107,7 +112,7 @@
|
|||||||
|
|
||||||
- name: APT-Cache aktualisieren
|
- name: APT-Cache aktualisieren
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
cache_valid_time: "{{ apt_cache_valid_time }}"
|
cache_valid_time: "{{ apt_cache_valid_time }}"
|
||||||
|
|
||||||
- name: Verifikation - zeigen, ob Suites auf trixie stehen
|
- name: Verifikation - zeigen, ob Suites auf trixie stehen
|
||||||
@@ -118,4 +123,3 @@
|
|||||||
- name: Ausgabe anzeigen (nur Info)
|
- name: Ausgabe anzeigen (nur Info)
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ apt_policy.stdout.split('\n') | select('search', 'trixie') | list | join('\n') }}"
|
msg: "{{ apt_policy.stdout.split('\n') | select('search', 'trixie') | list | join('\n') }}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user