fix(playbooks): apply the apt lock wait to every apt task #41
Loading…
Reference in a new issue
No description provided.
Delete branch "jfraeys/fix/apt-lock-module-defaults"
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 runs fail intermittently with
Unable to acquire the dpkg frontend lock(latest: the crowdsec=1.8.1 install on staging-web, withDPkg::Lock::Timeout=60in the command).Cause: playbooks/web.yml set
lock_timeout: 120as a parameter of the one "Install UFW" task. Every other apt task in every role kept the module default of 60s, so a fresh VM whose unattended-upgrades/apt-daily holds the dpkg lock past 60s fails whichever apt task runs next. ci-ephemeral.yml already uses the right pattern (play-levelmodule_defaults).Fix: play-level
module_defaults: ansible.builtin.apt: lock_timeout: 300in web.yml, services.yml and hardening.yml; the now-redundant per-task parameter is removed.Verified: syntax-check of all three; in a scratch play, an apt task inside a role gets lock_timeout 300 with the default and 60 without it.
Not verified: the race itself is nondeterministic, so one green staging run proves little; it needs a few.
🤖 Generated with Claude Code