diff mbox series

[v1,2/4] linux-mirror: Ensure git-daemon runs as the Ansible user

Message ID 20250310183208.999430-3-cel@kernel.org (mailing list archive)
State New
Headers show
Series Fixes for git mirroring on Fedora | expand

Commit Message

Chuck Lever March 10, 2025, 6:32 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

In my initial installation, git-daemon emits the "safe.directory"
warning and exits; remote attempts to access the repos there fail.

git-daemon needs to run as the same user that owns the repos to
avoid this warning. linux-mirror doesn't currently have a consistent
"user" for this: the instructions say "create a /mirror directory"
but then later tasks in linux-mirror try to create /mirror owned
by root.

This patch doesn't address that larger problem, but it simply
adds a setting under the daemon's [Service] stanza to make it
run as the user that is setting up the mirror.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/linux-mirror/templates/git-daemon@.service.j2 | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/playbooks/roles/linux-mirror/templates/git-daemon@.service.j2 b/playbooks/roles/linux-mirror/templates/git-daemon@.service.j2
index a8bf669608bc..06c08d989545 100644
--- a/playbooks/roles/linux-mirror/templates/git-daemon@.service.j2
+++ b/playbooks/roles/linux-mirror/templates/git-daemon@.service.j2
@@ -7,3 +7,4 @@  ExecStart=-/usr/bin/git daemon --verbose --init-timeout=10 --timeout=5 --inetd -
 StandardInput=socket
 StandardOutput=inherit
 StandardError=journal
+User={{ ansible_user_id }}