fix-ifupdown-resolved-hook.yml: patch all top-level 'return' in both resolved hooks.

The workaround only replaced two of the three top-level 'return' in
/etc/network/if-up.d/resolved (the 'ifindex' case was missing) and did
not touch /etc/network/if-down.d/resolved at all.

Now both hooks are diverted and every line consisting only of 'return'
becomes 'exit 0' (same behaviour as under dash); the result is checked
with 'bash -n'. The block only runs on Debian based systems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrisandClaude Opus 5.5 committed 2026-11-22 01:41:09 +01:00
1 parent 57a44bcfd0
commit 6e8032725e
2 files changed
+53 -35

No files matched your search

+6 -8
View File
@@ -35,15 +35,13 @@
- ansible_facts['distribution'] == "Debian"
tags: apt
# Workaround für einen ifupdown-Paketbug: /etc/network/if-up.d/resolved verwendet
# "return" auf oberster Ebene, was unter dash/bash fehlschlägt, wenn das Skript
# von run-parts direkt ausgeführt (nicht gesourced) wird. Das lässt "ifup"/
# "systemctl restart networking" abbrechen, bevor Interfaces konfiguriert werden.
# Workaround ifupdown-Paketbug: /etc/network/if-{up,down}.d/resolved verwenden
# "return" auf oberster Ebene, was mit /bin/sh -> bash (basic.yml, Tag
# symlink-sh) fehlschlägt: "ifup lo" scheitert, networking.service "failed".
#
# Betroffen nur, wenn:
# - das Paket ifupdown installiert ist, UND
# - die Datei /etc/network/if-up.d/resolved existiert (d.h. systemd-resolved-
# Integration von ifupdown vorhanden)
# tags supported inside fix-ifupdown-resolved-hook.yml
#
# fix-ifupdown-resolved-hook
- name: Fix ifupdown resolved-Hook (return-Bug)
ansible.builtin.include_tasks: fix-ifupdown-resolved-hook.yml