Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-2.9] fix: Wait for concurrent apt process to release lock #1179

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions ansible/roles/packages/tasks/debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
name: apt-transport-https
state: latest
update_cache: true
register: result
until: result is success
retries: 3
delay: 3

register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: apt update package management cache
apt:
update_cache: true
register: result
until: result is success
retries: 3
delay: 3
register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: install common debs
apt:
Expand All @@ -26,10 +25,10 @@
- python3-cryptography
- python3-pip
state: present
register: result
until: result is success
retries: 3
delay: 3
register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: install pinned debs
apt:
Expand All @@ -56,20 +55,20 @@
name: kubelet={{ package_versions.kubernetes_deb }}
state: present
force: true
register: kubelet_installation_deb
until: kubelet_installation_deb is success
retries: 3
delay: 3
register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: install kubectl deb package
apt:
name: kubectl={{ package_versions.kubernetes_deb }}
state: present
force: true
register: result
until: result is success
retries: 3
delay: 3
register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: add version hold for kubelet and kubectl packages
command: apt-mark hold {{ item }}
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/sysprep/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
autoclean: true
autoremove: true
force_apt_get: true
register: apt_lock_status
until: apt_lock_status is not failed
retries: 5
delay: 10

- name: Remove apt package lists
file:
Expand Down
Loading