From 6efc31c2dfa7124f8bc9a120183ff9629e809b00 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 20 Jul 2016 16:29:39 -0600 Subject: [PATCH] Use flock to avoid race conditions with git Signed-off-by: Zack Cerza --- .../templates/triggers/install/post/cephlab_ansible.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh b/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh index 3889bcf..23bd33d 100644 --- a/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh +++ b/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh @@ -19,11 +19,11 @@ if [ $SECRETS_REPO_NAME != 'UNDEFINED' ] then ANSIBLE_SECRETS_PATH=/root/$SECRETS_REPO_NAME pushd $ANSIBLE_SECRETS_PATH - git pull + flock --close ./.lock git pull popd fi pushd $ANSIBLE_CM_PATH -git pull +flock --close ./.lock git pull export ANSIBLE_SSH_PIPELINING=1 export ANSIBLE_HOST_KEY_CHECKING=False # Tell ansible to create users and populate authorized_keys -- 2.39.5