From 36b214401d44aaf7d2553390863d1ee4b556613b Mon Sep 17 00:00:00 2001 From: mg Date: Thu, 14 Apr 2022 12:29:00 +0200 Subject: [PATCH] Bugfix: git: unsafe repository (REPO is owned by someone else) (#354) Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/354 Co-authored-by: mg Co-committed-by: mg --- roles/mgrote.dotfiles/tasks/main.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/mgrote.dotfiles/tasks/main.yml b/roles/mgrote.dotfiles/tasks/main.yml index 5920409b..2b758908 100644 --- a/roles/mgrote.dotfiles/tasks/main.yml +++ b/roles/mgrote.dotfiles/tasks/main.yml @@ -10,6 +10,12 @@ path: "{{ dotfiles_repo_path }}" register: repo_exists + - name: set safe directory + become: true + ansible.builtin.shell: + cmd: git config --global --add safe.directory "{{ dotfiles_repo_path }}" + changed_when: false + - name: stash changes ansible.builtin.shell: git stash args: @@ -39,7 +45,7 @@ state: directory with_items: "{{ dotfiles_dirs }}" - - name: Link dotfiles into home folder. + - name: Link dotfiles into home folder file: src: "{{ item.repo_path }}" dest: "{{ item.local_path }}"