summaryrefslogtreecommitdiff
path: root/roles/gitolite/http/tasks/main.yml
blob: a30559024a57da21568edb80058704ccf7ca43f0 (plain) (blame)
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
---
- name: install cgit and fcgiwrap
  apt:
    name:
    - cgit
    - python3-pygments
    - fcgiwrap
    state: present

### TODO: this might break stuff..
- name: mask default fcgiwrap systemd units
  loop:
  - socket
  - service
  systemd:
    name: "fcgiwrap.{{ item }}"
    state: stopped
    masked: yes

- name: install fcgiwrap systemd units
  loop:
  - socket
  - service
  template:
    src: "fcgiwrap.{{ item }}.j2"
    dest: "/etc/systemd/system/fcgiwrap-gitolite-{{ gitolite_instance }}.{{ item }}"

- name: make sure fcgiwrap systemd socket unit is enabled and started
  systemd:
    daemon_reload: yes
    name: "fcgiwrap-gitolite-{{ gitolite_instance }}.socket"
    state: started
    enabled: yes

- name: generate cgitrc
  template:
    src: cgitrc.j2
    dest: "{{ gitolite_base_path }}/{{ gitolite_instance }}/cgitrc"

- name: install custom logo
  when: "'logo' in gitolite_instances[gitolite_instance].http"
  block:
  - name: create logo base directory
    file:
      path: /usr/local/share/cgit
      state: directory

  - name: copy logo file
    copy:
      src: "{{ gitolite_instances[gitolite_instance].http.logo }}"
      dest: "/usr/local/share/cgit/{{ gitolite_instance }}.png"

- name: install nginx vhost
  vars:
    nginx_vhost:
      name: "gitolite-{{ gitolite_instance }}"
      acme: true
      hostnames: "{{ gitolite_instances[gitolite_instance].http.hostnames }}"
      content: "{{ lookup('template', 'nginx-vhost.conf.j2') }}"
  include_role:
    name: nginx/vhost