aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2016-04-10 00:39:47 -0400
committerbnewbold <bnewbold@robocracy.org>2016-04-10 01:41:12 -0400
commit8e24c71b16c55752a4cdbf37748b57317d5abbfd (patch)
tree17d90a9dd822b705078a2c318c271df2298d2b05 /roles
parent1495cb21f26faa0fa1e17e92e601b8e5b6ac785b (diff)
downloadinfra-8e24c71b16c55752a4cdbf37748b57317d5abbfd.tar.gz
infra-8e24c71b16c55752a4cdbf37748b57317d5abbfd.zip
git: add git-daemon config
Diffstat (limited to 'roles')
-rw-r--r--roles/git/handlers/main.yml6
-rw-r--r--roles/git/tasks/cgit.yml10
-rw-r--r--roles/git/tasks/git-daemon.yml14
-rw-r--r--roles/git/tasks/main.yml1
-rw-r--r--roles/git/templates/etc_default_git-daemon.j216
5 files changed, 47 insertions, 0 deletions
diff --git a/roles/git/handlers/main.yml b/roles/git/handlers/main.yml
new file mode 100644
index 0000000..bc100db
--- /dev/null
+++ b/roles/git/handlers/main.yml
@@ -0,0 +1,6 @@
+---
+- name: fcgiwrap restart
+ service: name=fcgiwrap state=restarted enabled=yes
+
+- name: git-daemon restart
+ service: name=git-daemon state=restarted enabled=yes
diff --git a/roles/git/tasks/cgit.yml b/roles/git/tasks/cgit.yml
index 3362d2c..b70c382 100644
--- a/roles/git/tasks/cgit.yml
+++ b/roles/git/tasks/cgit.yml
@@ -8,6 +8,15 @@
tags:
- dependencies
+- name: Create dir to work around bug in debian jessie cgit
+ when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "8")
+ file: state=directory
+ path=/var/cache/cgit
+ group=www-data
+ owner=www-data
+ mode=0772
+ recurse=yes
+
- name: Copy cgitrc
template: src=etc_cgitrc.j2 dest=/etc/cgitrc
group=www-data
@@ -20,6 +29,7 @@
group=www-data
mode=0775
recurse=yes
+ notify: fcgiwrap restart
- name: Upload Custom cgit Static Files (css, robots.txt, logo, etc)
copy: src={{ item.src }} dest={{ item.dest }}
diff --git a/roles/git/tasks/git-daemon.yml b/roles/git/tasks/git-daemon.yml
new file mode 100644
index 0000000..793275c
--- /dev/null
+++ b/roles/git/tasks/git-daemon.yml
@@ -0,0 +1,14 @@
+
+- name: Install git-daemon-sysvinit package
+ apt: pkg={{ item }} state=installed
+ with_items:
+ - git-daemon-sysvinit
+ tags:
+ - dependencies
+
+- name: Configure git-daemon
+ template: src=etc_default_git-daemon.j2
+ dest=/etc/default/git-daemon
+ group=root
+ owner=root
+ notify: git-daemon restart
diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml
index 33302ee..c90c0a9 100644
--- a/roles/git/tasks/main.yml
+++ b/roles/git/tasks/main.yml
@@ -1,2 +1,3 @@
- include: gitolite.yml tags=gitolite
- include: cgit.yml tags=cgit
+- include: git-daemon.yml tags=git-daemon
diff --git a/roles/git/templates/etc_default_git-daemon.j2 b/roles/git/templates/etc_default_git-daemon.j2
new file mode 100644
index 0000000..36863c0
--- /dev/null
+++ b/roles/git/templates/etc_default_git-daemon.j2
@@ -0,0 +1,16 @@
+# Defaults for git-daemon initscript
+# sourced by /etc/init.d/git-daemon
+# installed at /etc/default/git-daemon by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+GIT_DAEMON_ENABLE=true
+GIT_DAEMON_USER=git
+GIT_DAEMON_BASE_PATH=/srv/gitolite/repositories
+GIT_DAEMON_DIRECTORY=/srv/gitolite/repositories
+
+# Additional options that are passed to the Daemon.
+GIT_DAEMON_OPTIONS=""
+