From d2816e2a5fd492ba90c7c95f5fc9f8d6515f8dae Mon Sep 17 00:00:00 2001 From: mg Date: Thu, 14 Apr 2022 13:23:39 +0200 Subject: [PATCH] Bugfix: vim+docker: unsafe repository (REPO is owned by someone else) (#355) https://git.mgrote.net/mg/ansible/commit/36b214401d44aaf7d2553390863d1ee4b556613b Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/355 Co-authored-by: mg Co-committed-by: mg --- .../tasks/dockercompose-up.yml | 6 ++++++ roles/mgrote.vim/tasks/main.yml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/roles/mgrote.docker-compose-deploy/tasks/dockercompose-up.yml b/roles/mgrote.docker-compose-deploy/tasks/dockercompose-up.yml index b3e27379..68989430 100644 --- a/roles/mgrote.docker-compose-deploy/tasks/dockercompose-up.yml +++ b/roles/mgrote.docker-compose-deploy/tasks/dockercompose-up.yml @@ -18,6 +18,12 @@ path: "{{ project_dir }}" register: repo_exists + - name: set safe directory + become: true + ansible.builtin.shell: + cmd: git config --global --add safe.directory "{{ project_dir }}" + changed_when: false + - name: stash changes - "{{ item.name }}" ansible.builtin.shell: git stash args: diff --git a/roles/mgrote.vim/tasks/main.yml b/roles/mgrote.vim/tasks/main.yml index b1045053..a3571812 100644 --- a/roles/mgrote.vim/tasks/main.yml +++ b/roles/mgrote.vim/tasks/main.yml @@ -13,6 +13,13 @@ path: "{{ vim_vundle_path }}" register: folder_exists + + - name: set safe directory + become: true + ansible.builtin.shell: + cmd: git config --global --add safe.directory "{{ vim_vundle_path }}" + changed_when: false + - name: Ensure repository is cloned locally. git: repo: "{{ vim_vundle_repo_url }}"