aboutsummaryrefslogtreecommitdiffstats
path: root/roles/cgit/tasks/main.yml
blob: 245b34ff7f183c50bc40796f38a61e5792821bb0 (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
- name: install cgit packages
  ansible.builtin.package:
    name:
      - cgit
      - lowdown
    state: present

- name: create cgit cache directory
  ansible.builtin.file:
    path: "{{ cgit_chroot_dir }}/cache/cgit"
    owner: www
    group: www
    mode: 0750
    state: directory

- name: generate cgit configuration files
  ansible.builtin.template:
    src: "{{ item.template }}"
    dest: "{{ item.file }}"
    owner: 0
    group: 0
    mode: 0644
  loop:
    - ansible.builtin.template: cgitrc.j2
      file: "{{ cgit_chroot_dir }}/conf/cgitrc"
    - ansible.builtin.template: footer.html.j2
      file: "{{ cgit_chroot_dir }}/conf/footer.html"
    - ansible.builtin.template: httpd.conf.j2
      file: /etc/httpd.d/cgit.conf

- name: include dependencies for lowdown
  ansible.builtin.include_tasks: dependencies.yml

- name: copy about-filter generator
  ansible.builtin.copy:
    src: about-filter.sh
    dest: "{{ cgit_chroot_dir }}/bin/about-filter.sh"
    owner: 0
    group: 0
    mode: 0755

- name: start and enable slowcgi service
  ansible.builtin.service:
    name: slowcgi
    state: restarted
    enabled: true

- name: httpd password information
  ansible.builtin.debug:
    msg: |
      Please provide a password using htpasswd,
      in "{{ cgit_chroot_dir }}/htpasswd/cgit"
  when: cgit_authenticate
remember that computers suck.