diff --git a/roles/git/server/tasks/main.yml b/roles/git/server/tasks/main.yml index e8aea839a3..5de1421862 100644 --- a/roles/git/server/tasks/main.yml +++ b/roles/git/server/tasks/main.yml @@ -1,16 +1,33 @@ --- # tasklist for setting up a git server (git:// access) -- name: install the needed packages - yum: pkg={{item}} state=present - with_items: - - git-daemon - - xinetd +- name: install the git-daemon package + yum: pkg=git-daemon state=present + +# If NOT using xinetd +- name: delete stock git daemon config + file: path="/usr/lib/systemd/system/git.service" state=absent + when: ansible_distribution_major_version == '7' + +- name: configure git daemon + template: > + src="git@.service.j2" + dest="/usr/lib/systemd/system/git@.service" + mode=0644 + when: ansible_distribution_major_version == '7' + notify: + - restart git.socket + +# If using xinetd +- name: install xinetd + yum: pkg=xinetd state=present + when: ansible_distribution_major_version == '6' - name: install the xinetd config file template: > src="git.j2" dest="/etc/xinetd.d/git" mode=0644 + when: ansible_distribution_major_version == '6' notify: - restart xinetd diff --git a/roles/git/server/templates/git@.service b/roles/git/server/templates/git@.service new file mode 100644 index 0000000000..1209f4240b --- /dev/null +++ b/roles/git/server/templates/git@.service @@ -0,0 +1,9 @@ +[Unit] +Description=Git Repositories Server Daemon +Documentation=man:git-daemon(1) +Wants=git.socket + +[Service] +User=nobody +ExecStart=/usr/libexec/git-core/git-daemon --base-path={{ git_basepath }} --export-all --user-path=public_git --syslog --inetd --verbose +StandardInput=socket