From 205e2c9ed58f9362f4ab2df134af98eee6e3f22b Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Thu, 27 Jun 2024 10:54:38 +0200 Subject: [PATCH] distgit/pagure: Set git directories as safe This was fixed previously for pagure.io in the context of paguremirroring. Turns out, it affects all kinds of git operations, so document and move accordingly. Fixes: releng#12181 Fixes: fedora-infrastructure#12010 Signed-off-by: Nils Philippsen --- roles/distgit/pagure/tasks/main.yml | 9 +++++++++ roles/pagure/tasks/main.yml | 21 +++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/roles/distgit/pagure/tasks/main.yml b/roles/distgit/pagure/tasks/main.yml index 4235404d3f..839180478f 100644 --- a/roles/distgit/pagure/tasks/main.yml +++ b/roles/distgit/pagure/tasks/main.yml @@ -182,6 +182,15 @@ - gitolite - pagure +# On RHEL 8.8 and newer, git operations fail because of dubious ownership. This should fix it. +- name: Configure git directories as safe + git_config: + name: safe.directory + scope: system + value: "*" + tags: + - pagure + - name: Install the apache configuration file template: src={{ item }} dest=/etc/httpd/conf.d/{{ item }} owner=root group=root mode=0644 diff --git a/roles/pagure/tasks/main.yml b/roles/pagure/tasks/main.yml index 9f88f6822d..d13ed5782b 100644 --- a/roles/pagure/tasks/main.yml +++ b/roles/pagure/tasks/main.yml @@ -168,6 +168,15 @@ tags: - pagure +# On RHEL 8.8 and newer, git operations fail because of dubious ownership. This should fix it. +- name: Configure git directories as safe + git_config: + name: safe.directory + scope: system + value: "*" + tags: + - pagure + # Set things up for the mirroring feature - name: create the `paguremirroring` group @@ -189,18 +198,6 @@ - pagure - mirror -# On RHEL 8.8 and newer the paguremirroring fails -# because of dubious ownership. This is allowing -# paguremirroring to work again -- name: Configure git directories as safe - git_config: - name: safe.directory - scope: system - value: "*" - tags: - - pagure - - mirror - # Set-up postfix and the milter for postfix - name: Add the /etc/aliases file