aboutsummaryrefslogtreecommitdiff
path: root/roles/cgit/tasks/main.yml
blob: 44f9459d46215ee792753360f14a7f9e06acffe8 (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
---
- name: Install cgit and FastCGI dependencies
  ansible.builtin.apt:
    name:
      - cgit
      - fcgiwrap
      - python3-pygments
      - python3-markdown
    state: present

- name: Ensure Git repositories root directory exists
  ansible.builtin.file:
    path: "{{ cgit_repos_path }}"
    state: directory
    owner: www-data
    group: www-data
    mode: "0755"

- name: Deploy /etc/cgitrc configuration
  ansible.builtin.template:
    src: cgitrc.j2
    dest: /etc/cgitrc
    owner: root
    group: root
    mode: "0644"

- name: Ensure fcgiwrap socket/service is enabled and running
  ansible.builtin.systemd:
    name: fcgiwrap.socket
    enabled: true
    state: started

- name: Deploy Nginx virtual host for cgit
  ansible.builtin.template:
    src: site-cgit.conf.j2
    dest: /etc/nginx/sites-available/cgit.conf
    owner: root
    group: root
    mode: "0644"
  notify: Reload nginx

- name: Enable Nginx virtual host for cgit
  ansible.builtin.file:
    src: /etc/nginx/sites-available/cgit.conf
    dest: /etc/nginx/sites-enabled/cgit.conf
    state: link
  notify: Reload nginx