Set more specific sudoers permissions for git user

This commit is contained in:
Tunui Franken 2024-04-07 12:49:52 +02:00
parent e0cfde4c9f
commit 808a40ac68
2 changed files with 4 additions and 2 deletions

View file

@ -46,8 +46,8 @@
- name: Set sudoer permissions to git user
become: true
ansible.builtin.copy:
content: 'git ALL=(root) NOPASSWD:/usr/bin/systemctl'
ansible.builtin.template:
src: sudoers.d/git.j2
dest: /etc/sudoers.d/git
owner: root
group: root

View file

@ -0,0 +1,2 @@
git ALL=(root) NOPASSWD:/usr/bin/systemctl stop forgejo.service
git ALL=(root) NOPASSWD:/usr/bin/systemctl restart forgejo.service