summaryrefslogtreecommitdiff
path: root/roles/cgit/tasks/main.yaml
blob: cc18696567ade719fbf97a3e68fdcbdb0bf852d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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}}"