I am attempting to run git add --all in a new project folder. The host I am running this command from is Ubuntu. Here is the error message that I am receiving:
fatal: detected dubious ownership in repository at '/etc/ansible'
To add an exception for this directory, call:
git config --global --add safe.directory /etc/ansible
I am the ansible user, and here are the directory permissions:
drwxrwx--- 5 root ansible 14 Jan 12 14:35 ansible
Did a bit of research, and was told not to run this command unless you know what it does. I am also trying to go by best practices.
If you are the ansible user in the ansible group executing the command, Git still thinks that only root:ansible is allowed to add the files.
root:ansible
ansible:ansible
Probably it is safe to add this as a safe directory using git config --global --add safe.directory /etc/ansible and continue working as low privileged users. I would not recommend changing the file system permissions - this could break Ansible itself, or the package where it is installed from (or on upgrades, permissions are reset again).