From: Zack Cerza Date: Wed, 20 Jul 2016 22:29:39 +0000 (-0600) Subject: Use flock to avoid race conditions with git X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F269%2Fhead;p=ceph-cm-ansible.git Use flock to avoid race conditions with git Signed-off-by: Zack Cerza --- diff --git a/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh b/roles/cobbler/templates/triggers/install/post/cephlab_ansible.sh index 3889bcf9..23bd33d2 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