Skip to content

Commit

Permalink
devconfig: fix firstconfig debian upgrade
Browse files Browse the repository at this point in the history
Ansible apt module documentation [1] states the following for upgrade
parameter:
  If yes or safe, performs an aptitude safe-upgrade.

  If full, performs an aptitude full-upgrade.

  If dist, performs an apt-get dist-upgrade.

[1]
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_
module.html

However, a non-related upgrade parameter issue, outputs the following:

TASK [devconfig : Debian-specific setup]
included:
/data4-xfs/gh/actions-runner/_work/kdevops/kdevops/playbooks/roles/devco
nfig/tasks/install-deps/debian/main.yml for 3f52d93-xfs-reflink-4k

TASK [devconfig : Upgrade Packages]
fatal: [3f52d93-xfs-reflink-4k]: FAILED! => {
    "changed": false,
    "rc": 100
}

MSG:

'/usr/bin/apt-get dist-upgrade ' failed: E: Could not get lock
/var/lib/dpkg/lock-frontend. It is held by process 1087 (apt)
E: Unable to acquire the dpkg frontend lock
(/var/lib/dpkg/lock-frontend), is another process using it?

Replace full upgrade value with yes/safe to perform apt upgrade/apt-get
upgrade.

While fixing this, during firstconfig, also increase the lock_timeout
from default 60s to 120s and retry 5 times the task or until success.

Fixes: 3f52d93 Revert "bringup: devconfig: fix python3-apt debian issue"

Signed-off-by: Daniel Gomez <[email protected]>
  • Loading branch information
dkruces committed Mar 6, 2025
1 parent 3f52d93 commit 734f0af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion playbooks/roles/devconfig/tasks/install-deps/debian/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
become: yes
become_method: sudo
ansible.builtin.apt:
upgrade: full
upgrade: "yes"
lock_timeout: 120
register: apt_upgrade
until: apt_upgrade is success
retries: 5
delay: 60
tags: firstconfig

- name: Remove unattended-upgrades package
Expand Down

0 comments on commit 734f0af

Please sign in to comment.