This commit is contained in:
Sergei Poljanski 2025-11-01 22:46:38 +02:00
commit 67414814c0
23 changed files with 310 additions and 190 deletions

View file

@ -0,0 +1,45 @@
---
- name: Create git user on host
user:
name: git
comment: "Forgejo Git User"
home: /var/lib/git
shell: /usr/local/bin/forgejo-shell
system: yes
create_home: yes
- name: Deploy forgejo-shell wrapper script
template:
src: forgejo-shell.j2
dest: /usr/local/bin/forgejo-shell
owner: root
group: root
mode: '0755'
- name: Create .ssh directory for git user
file:
path: /var/lib/git/.ssh
state: directory
owner: git
group: git
mode: '0700'
- name: Deploy SSH daemon configuration for Forgejo passthrough
template:
src: sshd-forgejo.conf.j2
dest: /etc/ssh/sshd_config.d/forgejo.conf
owner: root
group: root
mode: '0644'
notify: Reload SSH daemon
- name: Ensure docker group exists
group:
name: docker
state: present
- name: Add git user to docker group
user:
name: git
groups: docker
append: yes