Recover from half-done installs and missing devices instead of failing for good

- pi_shairport: on trixie systemd.pc moved into systemd-dev, so configure found no
  unit directory and `make install` died on an empty `install -d` - after it had
  already installed the binary. `creates:` then saw the binary and never retried, and
  the next tasks failed on the missing unit. Install systemd-dev on trixie, and key
  `creates:` on the unit file.
- pi_irserver: with the IRTrans receiver unplugged at boot, irserver exited at once and
  stayed failed. Restart it every 10s with no start limit until the device shows up.
- pi_modern_shell_env: get_url sent a conditional request to the oh-my-posh CDN on every
  run, so a TLS handshake timeout there failed the whole play with the binary already
  installed. Only download it when it is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 21:22:05 +02:00
parent c3375bea75
commit a0546f5fa6
3 changed files with 29 additions and 16 deletions

View File

@@ -17,7 +17,17 @@
dest: /usr/local/bin/bat
state: link
- name: Check whether oh-my-posh is already installed
ansible.builtin.stat:
path: /usr/local/bin/oh-my-posh
register: pi_modern_shell_env_ohmyposh
- name: Download oh-my-posh binary
# Only when missing. With the file present get_url still sends a conditional request
# every run, so a CDN that is slow or unreachable from the device (TLS handshake
# timeouts happen) failed the whole play for a prompt that was already installed.
# Delete the binary to pick up a newer release.
when: not pi_modern_shell_env_ohmyposh.stat.exists
ansible.builtin.get_url:
# The official install script's own curl-based downloads are blocked by
# oh-my-posh's CDN on some devices (observed on Raspberry Pi OS's curl