aboutsummaryrefslogtreecommitdiff
path: root/infrastructure/roles/git/tasks/main.yaml
blob: 75da2e33fd1cee2a413bab84812271e23ff7deab (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
- name: install git
  ansible.builtin.package:
    name:
      - git
      - cgit
      - python3-markdown
- name: enable cgid
  ansible.builtin.command:
    cmd: a2enmod cgid
    creates: /etc/apache2/mods-enabled/cgid.load
  notify: restart web
- name: configure cgit
  ansible.builtin.copy:
    content: |
      #
      # cgit config
      # see cgitrc(5) for details

      css=/cgit-css/cgit.css
      logo=/cgit-css/cgit.png

      about-filter=/usr/lib/cgit/filters/about-formatting.sh
      readme=:README.md
      clone-url=https://ñix.es/cgit/$CGIT_REPO_URL ñix.es:/srv/repos/$CGIT_REPO_URL

      scan-path=/srv/repos
    dest: /etc/cgitrc
- name: create repository directory
  ansible.builtin.file:
    path: /srv/repos/
    state: directory
    owner: nobody
    group: www-data
- name: create user repository directories
  ansible.builtin.file:
    path: "/srv/repos/{{ item.name }}"
    state: directory
    owner: "{{ item.name }}"
    group: "{{ item.name }}"
  loop: "{{ users }}"
  loop_control:
    label: "{{ item.name }}"