From 3b9a0f49a3904481e84ac305c646e2d411620605 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 26 May 2022 09:33:50 +0100 Subject: [PATCH] Avoid a race condition between mounting and using repo filesystem Wait until the path is confirmed to be a mountpoint. Change-Id: If220d073147d8f424cfe4f0d1ab494144b406860 --- tasks/repo_pre_install.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/repo_pre_install.yml b/tasks/repo_pre_install.yml index ab555a3..bd7698a 100644 --- a/tasks/repo_pre_install.yml +++ b/tasks/repo_pre_install.yml @@ -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: