Skip to content

Commit

Permalink
add lockfix task
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanis committed Aug 3, 2024
1 parent 9c637d5 commit 180b89f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tasks/wait_for_locks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: wait_for_locks | Wait or cloud-init to finish
community.general.cloud_init_data_facts:
filter: status
register: ciresult
until:
- ciresult.cloud_init_data_facts.status.v1.stage is defined
- not ciresult.cloud_init_data_facts.status.v1.stage
retries: 50
delay: 10

- name: wait_for_locks | Wait for automatic system updates
ansible.builtin.shell:
cmd: fuser {{ item }} >/dev/null 2>&1
loop:
- /var/lib/dpkg/lock
- /var/lib/dpkg/lock-frontend
- /var/lib/rpm/.rpm.lock
register: lockresult
until:
- lockresult.rc == 1
changed_when:
- lockresult.rc == 0
failed_when: false
retries: 50
delay: 10

0 comments on commit 180b89f

Please sign in to comment.