Skip to content

fix: repair apt state before security updates in xqueue playbook - #389

Merged
naincy128 merged 1 commit into
masterfrom
naincy/xqueue-repair-apt-state
Oct 6, 2026
Merged

naincy128 merged 1 commit into
masterfrom
naincy/xqueue-repair-apt-state

Conversation

@naincy128

@naincy128 naincy128 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR resolves deployment pipeline hangs and failures on TASK [security : Take security updates during ansible runs] caused by APT lock contention, interactive prompts, and unattended-upgrade failures during EC2 provisioning.

Problem

When provisioning new or existing EC2 instances during GoCD pipeline runs (e.g. stage-xqueue), the security role's Take security updates during ansible runs task executes unattended-upgrade --dry-run followed by unattended-upgrade.

During runs against instances with pending package upgrades or active background boot services (unattended-upgrades.service, apt-daily.timer):

  1. unattended-upgrade fails or encounters non-zero exit codes during initial package resolution.
  2. Ansible enters a 10-retry loop (retries: 10), with each attempt taking 10–12 minutes to resolve dependencies and download packages.
  3. This leads to 1.5–2 hour runtimes that eventually hit the GoCD agent job execution timeout (exited: 2).

Changes

  • Updated playbooks/roles/security/tasks/security-ubuntu.yml (and related security tasks) to ensure non-interactive execution and clean package state handling before running security upgrades.

Run dpkg --configure -a, apt-get -f install and apt-get update as a
pre_task so unattended-upgrade in the security role doesn't fail on
an interrupted dpkg run or broken packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@naincy128
naincy128 merged commit e7326e2 into master Oct 6, 2026
3 checks passed
@naincy128
naincy128 deleted the naincy/xqueue-repair-apt-state branch October 6, 2026 12:45
naincy128 added a commit that referenced this pull request Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants