From 2d16f11215ccabf5def8af2e1bd02ed6f5cc412c Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Thu, 5 Dec 2024 12:43:50 -0600 Subject: [PATCH] feat(#528): allow `roundup` group users to interact with git repos (#530) --- salt/bugs/init.sls | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/salt/bugs/init.sls b/salt/bugs/init.sls index a7dd6ebe..96b4e46a 100644 --- a/salt/bugs/init.sls +++ b/salt/bugs/init.sls @@ -3,6 +3,13 @@ include: - bugs.postgresql - nginx +ensure-gitconfig-permissions: + file.managed: + - name: /etc/gitconfig + - user: root + - group: root + - mode: "0644" + roundup-deps: pkg.installed: - pkgs: @@ -235,6 +242,14 @@ tracker-{{ tracker }}-clone-permissions: - name: /srv/roundup/trackers/{{ tracker }} - mode: "0750" +tracker-{{ tracker }}-add-safe-directory: + cmd.run: + - name: git config --system --add safe.directory "/srv/roundup/trackers/{{ tracker }}" + - unless: git config --system --get-all safe.directory | grep -q "^/srv/roundup/trackers/{{ tracker }}$" + - require: + - file: tracker-{{ tracker }}-clone-permissions + - file: ensure-gitconfig-permissions + tracker-{{ tracker }}-config: file.managed: - name: /srv/roundup/trackers/{{ tracker }}/config.ini