Skip to content

Commit e897626

Browse files
committed
fix: Allow non-interactive upgrades with apt
1 parent 48df126 commit e897626

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424

2525
- Restricted filesystem usage for journal service and file rotation strategy [#10518](https://github.com/opencrvs/opencrvs-core/issues/10518))
2626

27+
28+
### Bug fixes
29+
30+
- Allow non-interactive upgrades with apt [#10204](https://github.com/opencrvs/opencrvs-core/issues/10204)
31+
2732
## 1.8.1
2833

2934
### Bug fixes

infrastructure/server-setup/playbook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
apply:
3232
tags:
3333
- updates
34+
tags:
35+
- updates
3436

3537
- include_tasks:
3638
file: tasks/users.yml

infrastructure/server-setup/tasks/updates.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
- name: Update apt repository
1+
- name: Update and upgrade system packages
22
apt:
33
update_cache: yes
4-
force_apt_get: yes
4+
upgrade: dist
5+
autoremove: yes
6+
register: upgrade_result
7+
retries: 5
8+
delay: 10
59

6-
- name: Manage apt updates, upgrades, and package installation
7-
shell: |
8-
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sleep 5; done
9-
apt-get update && apt-get dist-upgrade -y
10-
apt-get install -y unattended-upgrades
11-
apt-get autoremove -y
12-
apt-get autoclean -y
10+
- name: Install unattended-upgrades
11+
apt:
12+
name: unattended-upgrades
13+
state: present
14+
15+
- name: Autoclean apt cache
16+
apt:
17+
autoclean: yes
1318

1419
- name: Configure Unattended Upgrades
1520
ansible.builtin.copy:

0 commit comments

Comments
 (0)