diff options
| author | 2026-10-22 20:28:49 +0000 | |
|---|---|---|
| committer | 2026-10-22 20:28:49 +0000 | |
| commit | 84682c67b65e51be9168bb87d30d31bbd6d614a5 (patch) | |
| tree | 7bcc1aaa0fdaaf494379d67694007b61462f684a /roles/cgit/tasks/main.yml | |
| parent | feat: add private (diff) | |
| download | infra-84682c67b65e51be9168bb87d30d31bbd6d614a5.tar.gz | |
feat: add cgit
Diffstat (limited to 'roles/cgit/tasks/main.yml')
| -rw-r--r-- | roles/cgit/tasks/main.yml | 52 |
1 files changed, 52 insertions, 0 deletions
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 @@ | |||
| 1 | --- | ||
| 2 | - block: | ||
| 3 | - name: Install CGit and FastCGI wrapper packages | ||
| 4 | community.general.apk: | ||
| 5 | name: | ||
| 6 | - cgit | ||
| 7 | - fcgiwrap | ||
| 8 | - spawn-fcgi | ||
| 9 | - py3-pygments | ||
| 10 | state: present | ||
| 11 | |||
| 12 | - name: Ensure root CGit configuration exists | ||
| 13 | ansible.builtin.template: | ||
| 14 | src: cgitrc.j2 | ||
| 15 | dest: "/etc/cgitrc" | ||
| 16 | owner: root | ||
| 17 | group: root | ||
| 18 | mode: '0444' | ||
| 19 | |||
| 20 | - name: Ensure {{ instance }} CGit configuration exists | ||
| 21 | ansible.builtin.template: | ||
| 22 | src: cgitrc-instance.j2 | ||
| 23 | dest: "/etc/cgitrc-{{ instance }}" | ||
| 24 | owner: root | ||
| 25 | group: root | ||
| 26 | mode: '0444' | ||
| 27 | |||
| 28 | - name: Create OpenRC init script symlink | ||
| 29 | ansible.builtin.file: | ||
| 30 | src: /etc/init.d/spawn-fcgi | ||
| 31 | dest: "/etc/init.d/spawn-fcgi.cgit" | ||
| 32 | state: link | ||
| 33 | owner: root | ||
| 34 | group: root | ||
| 35 | |||
| 36 | - name: Deploy spawn-fcgi configuration | ||
| 37 | ansible.builtin.template: | ||
| 38 | src: spawn-fcgi.cgit.j2 | ||
| 39 | dest: "/etc/conf.d/spawn-fcgi.cgit" | ||
| 40 | owner: root | ||
| 41 | group: root | ||
| 42 | mode: '0444' | ||
| 43 | notify: Restart spawn-fcgi.cgit | ||
| 44 | |||
| 45 | - name: Ensure spawn-fcgi.git is started and enabled | ||
| 46 | ansible.builtin.service: | ||
| 47 | name: "spawn-fcgi.cgit" | ||
| 48 | state: started | ||
| 49 | enabled: true | ||
| 50 | |||
| 51 | tags: | ||
| 52 | - cgit | ||
