From 84682c67b65e51be9168bb87d30d31bbd6d614a5 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Thu, 22 Oct 2026 23:28:49 +0300 Subject: feat: add cgit --- roles/cgit/tasks/main.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 roles/cgit/tasks/main.yml (limited to 'roles/cgit/tasks/main.yml') diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml new file mode 100644 index 0000000..15516d4 --- /dev/null +++ b/roles/cgit/tasks/main.yml @@ -0,0 +1,52 @@ +--- +- block: + - name: Install CGit and FastCGI wrapper packages + community.general.apk: + name: + - cgit + - fcgiwrap + - spawn-fcgi + - py3-pygments + state: present + + - name: Ensure root CGit configuration exists + ansible.builtin.template: + src: cgitrc.j2 + dest: "/etc/cgitrc" + owner: root + group: root + mode: '0444' + + - name: Ensure {{ instance }} CGit configuration exists + ansible.builtin.template: + src: cgitrc-instance.j2 + dest: "/etc/cgitrc-{{ instance }}" + owner: root + group: root + mode: '0444' + + - name: Create OpenRC init script symlink + ansible.builtin.file: + src: /etc/init.d/spawn-fcgi + dest: "/etc/init.d/spawn-fcgi.cgit" + state: link + owner: root + group: root + + - name: Deploy spawn-fcgi configuration + ansible.builtin.template: + src: spawn-fcgi.cgit.j2 + dest: "/etc/conf.d/spawn-fcgi.cgit" + owner: root + group: root + mode: '0444' + notify: Restart spawn-fcgi.cgit + + - name: Ensure spawn-fcgi.git is started and enabled + ansible.builtin.service: + name: "spawn-fcgi.cgit" + state: started + enabled: true + + tags: + - cgit -- cgit v1.3.1