fix(ansible): wait for background apt/dpkg to finish before the play (covers the archives lock) #71
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/apt-quiet-before-play"
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 487 stopped after 67 tasks at
hardening : Install auditd:Could not get lock /var/cache/apt/archives/lock. It is held by process ... (apt-get). #68'sDPkg::Lock::Timeoutonly covers the dpkg lock, and apt has no timeout for the archives lock.Also, the existing 'wait for the dpkg lock' pre-task in services.yml used
flock -n, which cannot see apt's fcntl locks (shown in a Debian 12 container earlier), so it never waited. It is replaced, and added to web/hardening/ci-ephemeral, by a wait that polls for apt, apt-get, dpkg, unattended-upgr and apt.systemd.dai by name (one pgrep -x per name, which is capped at 15 chars) for up to 15 minutes. Verified in a Debian 12 container: idle box not busy, busy while apt-get runs, idle again after. ansible-lint, yamllint and syntax-check pass for all four playbooks. 🤖 Generated with Claude Code