summaryrefslogtreecommitdiff
path: root/roles/cgit/tasks
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2015-08-28 15:38:36 +0200
committerChristian Franke <nobody@nowhere.ws>2015-08-28 15:38:36 +0200
commit1eb35a1e69d9a9f3f43340b9ea46d95bb2c1a0e8 (patch)
treec2f50624ccf38999896e66c9f270a96ee4cbb5cb /roles/cgit/tasks
parent6474bb9964d8a57b050e597a451fa40a3e5148f0 (diff)
Add cgit role - git webfrontend
Diffstat (limited to 'roles/cgit/tasks')
-rw-r--r--roles/cgit/tasks/main.yaml70
1 files changed, 70 insertions, 0 deletions
diff --git a/roles/cgit/tasks/main.yaml b/roles/cgit/tasks/main.yaml
new file mode 100644
index 0000000..cc18696
--- /dev/null
+++ b/roles/cgit/tasks/main.yaml
@@ -0,0 +1,70 @@
+---
+- name: Install cgit package and depencies
+ apt: name={{item}} state=present
+ with_items:
+ - cgit
+ - highlight
+
+- name: Install cgit highlighting script
+ copy:
+ src=cgit.source.filter
+ dest=/etc/cgit.source.filter
+ mode=0755
+
+- name: Create cgit assets dir
+ file:
+ name=/var/www/{{ git_server_name }}/static
+ recurse=yes
+ state=directory
+
+- name: Put cgit assets
+ copy:
+ src="cgit-assets/{{item}}"
+ dest="/var/www/{{ git_server_name }}/static/{{item}}"
+ with_items:
+ - git.css
+ - highlight.css
+ - logo.png
+
+- name: Symlink cgit css
+ file:
+ name="/var/www/{{git_server_name}}/static/cgit.css"
+ state=link
+ src=../../../../usr/share/cgit/cgit.css
+
+- name: Symlink robots.txt
+ file:
+ name="/var/www/{{git_server_name}}/robots.txt"
+ state=link
+ src=../../../usr/share/cgit/robots.txt
+
+- name: Put cgit configuration
+ template:
+ src=cgitrc.j2
+ dest=/etc/cgitrc
+
+- name: Put apache config
+ template:
+ src=vhost.conf.j2
+ dest=/etc/apache2/sites-enabled/cgit.conf
+
+- name: Create config snippet dir
+ file:
+ name=/etc/apache2/sites/{{ git_server_name }}
+ recurse=yes
+ state=directory
+
+- name: Place config snippets
+ template:
+ dest=/etc/apache2/sites/{{ git_server_name }}/{{ item }}
+ src={{ item }}.j2
+ with_items:
+ - repocreate-plain.conf
+ - repocreate-ssl.conf
+ - server.conf
+ - ssl.conf
+ notify: Reload apache
+
+- include: ../../apache/tasks/ssl.yaml
+ vars:
+ ssl_server_name: "{{git_server_name}}"