Skip to content

Commit

Permalink
Add play to wait for the snapshot to be synced and cleaned
Browse files Browse the repository at this point in the history
On a slower system the ansible can attempt to recreate the snapshot
before the old snaphot has finished syncing and still exists, this will
lead to failure to create new snapshot and exit form run.

Signed-off-by: Yair Podemsky <ypodemsk@redhat.com>
  • Loading branch information
Yair Podemsky committed Jan 8, 2025
1 parent 5af6766 commit d559338
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions roles/ci_restore_snapshot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
- name: Refresh LVM
command:
cmd: lvchange --refresh vg1

- name: wait until snapshot is cleared
ansible.builtin.shell: lvs -a
register: result
until: result.stdout | regex_search('root-snap', ignorecase=True) is none
retries: 6
delay: 10

- name: Recreate the snapshot
lvol:
vg: vg1
Expand Down

0 comments on commit d559338

Please sign in to comment.