Wait for the dpkg lock to get freed
Change-Id: I7aee4c1cc5e2473856fca58287fffa503193a199
diff --git a/playbooks/workarounds/01-disable-unattended-upgrades.yaml b/playbooks/workarounds/01-disable-unattended-upgrades.yaml
index f82f7d3..3c084f1 100644
--- a/playbooks/workarounds/01-disable-unattended-upgrades.yaml
+++ b/playbooks/workarounds/01-disable-unattended-upgrades.yaml
@@ -6,4 +6,13 @@
- name: Stop and disable the service unattended-upgrades
become: true
ignore_errors: true
- ansible.builtin.command: systemctl disable --now unattended-upgrades
\ No newline at end of file
+ ansible.builtin.command: systemctl disable --now unattended-upgrades
+
+ - name: Wait for the lock to get freed
+ become: true
+ ansible.builtin.stat:
+ path: /var/lib/dpkg/lock-frontend
+ register: fstat
+ retries: 3600
+ delay: 1
+ until: not fstat.stat.exists