From 1eb35a1e69d9a9f3f43340b9ea46d95bb2c1a0e8 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 28 Aug 2015 15:38:36 +0200 Subject: Add cgit role - git webfrontend --- roles/cgit/tasks/main.yaml | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 roles/cgit/tasks/main.yaml (limited to 'roles/cgit/tasks') 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}}" -- cgit v1.2.1