Use systemd service for git repository.
This commit is contained in:
parent
d7a1a146dd
commit
e51f6c5e2d
3 changed files with 25 additions and 23 deletions
|
@ -1,7 +1,7 @@
|
|||
- name: reload xinetd
|
||||
- name: start git-repo
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: xinetd
|
||||
state: reloaded
|
||||
name: git-repo
|
||||
state: started
|
||||
enabled: yes
|
||||
listen: reload xinetd
|
||||
listen: start git-repo
|
||||
|
|
|
@ -70,12 +70,8 @@
|
|||
update: no
|
||||
become_user: "ansible"
|
||||
|
||||
- name: install xinetd
|
||||
apt:
|
||||
name: xinetd
|
||||
|
||||
- name: enable git repo
|
||||
- name: start git-repo
|
||||
template:
|
||||
src: git-repo.j2
|
||||
dest: "/etc/xinetd.d/git-repo"
|
||||
notify: "reload xinetd"
|
||||
dest: "/etc/systemd/system/git-repo.service"
|
||||
notify: start git-repo
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
# Access to git repository.
|
||||
service git
|
||||
{
|
||||
disable = no
|
||||
type = UNLISTED
|
||||
port = 9418
|
||||
socket_type = stream
|
||||
wait = no
|
||||
user = nobody
|
||||
server = /usr/bin/git
|
||||
server_args = daemon --inetd --export-all --base-path={{ repo_dir }}
|
||||
}
|
||||
[Unit]
|
||||
Description=Start Git Daemon
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/git daemon --reuseaddr --export-all --base-path={{ repo_dir }}
|
||||
|
||||
Restart=always
|
||||
RestartSec=500ms
|
||||
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=git-daemon
|
||||
|
||||
User=nobody
|
||||
Group=nogroup
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Add table
Reference in a new issue