Avoid a race condition between mounting and using repo filesystem

Wait until the path is confirmed to be a mountpoint.

Change-Id: If220d073147d8f424cfe4f0d1ab494144b406860
This commit is contained in:
Jonathan Rosser 2022-05-26 09:33:50 +01:00
parent 4e5947dc1e
commit 3b9a0f49a3
1 changed files with 9 additions and 0 deletions

View File

@ -76,6 +76,15 @@
systemd_mounts: "{{ repo_server_systemd_mounts }}"
when: repo_server_systemd_mounts | length > 0
# NOTE(jrosser) ensure there is no race condition between mounting and using the filesystem
- name: Wait until {{ repo_service_home_folder }} is a mounted
command: mountpoint -q {{ repo_service_home_folder }}/repo
changed_when: false
register: _repo_folder_is_mounted
retries: 5
delay: 2
until: _repo_folder_is_mounted.rc == 0
# NOTE(jrosser) remove this task in release after Z
- name: Restore repo content from archive into new shared filesystem
unarchive: