fix(cloud-init): wait for the dpkg lock before apt installs on first boot #215

Merged
jfraeys merged 1 commit from jfraeys/fix/cloud-init-dpkg-lock into main 2026-10-16 11:19:02 -04:00
Owner

The OVH nodes (migration #187) booted with ufw, fail2ban and auditd missing and the firewall off: unattended-upgrades held the dpkg lock, 'apt-get install ufw' failed, and every later ufw rule printed 'ufw: not found'. Adds -o DPkg::Lock::Timeout=300 to the four apt-get installs in services.yml.tpl and essentials.yml.tpl. user_data is in ignore_changes for production nodes on both providers, so running nodes are not replaced. Not changed here: fail2ban and auditd are only enabled in cloud-init, never installed; the hardening role installs them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ

The OVH nodes (migration #187) booted with ufw, fail2ban and auditd missing and the firewall off: unattended-upgrades held the dpkg lock, 'apt-get install ufw' failed, and every later ufw rule printed 'ufw: not found'. Adds -o DPkg::Lock::Timeout=300 to the four apt-get installs in services.yml.tpl and essentials.yml.tpl. user_data is in ignore_changes for production nodes on both providers, so running nodes are not replaced. Not changed here: fail2ban and auditd are only enabled in cloud-init, never installed; the hardening role installs them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
fix(cloud-init): wait for the dpkg lock instead of failing the apt installs on first boot
All checks were successful
Lint / lint (pull_request) Successful in 2m31s
Secret scan / scan (pull_request) Successful in 15s
7847c6311e
On the OVH nodes unattended-upgrades held the dpkg lock, so 'apt-get install ufw' failed
and the firewall was never enabled (also ufw: not found for every later rule).
-o DPkg::Lock::Timeout=300 on the four installs. user_data changes are ignored on
production nodes, so this only affects newly created nodes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ge5tovcwdEUBtPwUktsZZZ
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!215
No description provided.