diff --git a/playbooks/roles/install-ansible-roles/tasks/main.yaml b/playbooks/roles/install-ansible-roles/tasks/main.yaml index 1662a5e394..6483bb4ccb 100644 --- a/playbooks/roles/install-ansible-roles/tasks/main.yaml +++ b/playbooks/roles/install-ansible-roles/tasks/main.yaml @@ -1,3 +1,13 @@ +- name: Mark source side of clone as safe + # This goes into a config file with many entries so we cannot set + # a creates attribute on this task. However, subsequent runs of this + # command seem to noop if the entries are already present so the impact + # is low. + command: git config --global safe.directory '{{ ansible_role_src_root }}/src/opendev.org/opendev/ansible-role-{{ ansible_role }}' + loop: '{{ ansible_roles }}' + loop_control: + loop_var: ansible_role + - name: Install ansible roles to /etc/ansible/roles git: repo: '{{ ansible_role_src_root }}/src/opendev.org/opendev/ansible-role-{{ ansible_role }}'