fix(ansible): wait on apt's real locks, not process names #72
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/apt-quiet-lock-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Staging run 491 (21 min): my new apt wait (#71) failed with
apt/dpkg still busy after 15 minutes. Matching process names was wrong:unattended-upgralso matches the permanently running unattended-upgrade-shutdown daemon, so the check was always busy.Now playbooks/files/apt-quiet.py tries the same fcntl locks apt takes (dpkg lock-frontend, dpkg lock, archives lock, lists lock) and waits until they are free, failing with the lock path after 900s. Tested in a Debian 12 container: a permanent process named unattended-upgr no longer blocks (rc 0, instant); an archives lock held 8s is waited out (rc 0, ~10s); a dpkg lock held past the timeout fails cleanly (rc 1, names the lock). Also verified ansible.builtin.script resolves files/apt-quiet.py next to the playbook. ansible-lint, yamllint and syntax-check pass for all four playbooks. 🤖 Generated with Claude Code