Use systemd service for git repository.

This commit is contained in:
Andreas B. Mundt 2019-05-24 19:58:20 +03:00
parent d7a1a146dd
commit e51f6c5e2d
3 changed files with 25 additions and 23 deletions

View file

@ -1,7 +1,7 @@
- name: reload xinetd - name: start git-repo
systemd: systemd:
daemon_reload: yes daemon_reload: yes
name: xinetd name: git-repo
state: reloaded state: started
enabled: yes enabled: yes
listen: reload xinetd listen: start git-repo

View file

@ -70,12 +70,8 @@
update: no update: no
become_user: "ansible" become_user: "ansible"
- name: install xinetd - name: start git-repo
apt:
name: xinetd
- name: enable git repo
template: template:
src: git-repo.j2 src: git-repo.j2
dest: "/etc/xinetd.d/git-repo" dest: "/etc/systemd/system/git-repo.service"
notify: "reload xinetd" notify: start git-repo

View file

@ -1,12 +1,18 @@
# Access to git repository. [Unit]
service git Description=Start Git Daemon
{
disable = no [Service]
type = UNLISTED ExecStart=/usr/bin/git daemon --reuseaddr --export-all --base-path={{ repo_dir }}
port = 9418
socket_type = stream Restart=always
wait = no RestartSec=500ms
user = nobody
server = /usr/bin/git StandardOutput=syslog
server_args = daemon --inetd --export-all --base-path={{ repo_dir }} StandardError=syslog
} SyslogIdentifier=git-daemon
User=nobody
Group=nogroup
[Install]
WantedBy=multi-user.target