summaryrefslogtreecommitdiffstats
path: root/roles/cgit/tasks/main.yml
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-16 14:39:19 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-16 17:02:52 +0200
commit756dc388bedf97b68449e919a6730788f730c7b8 (patch)
treece823916a242ea9d44194bbaf6da04d1596b935d /roles/cgit/tasks/main.yml
parentf79d1d829cdafebb5dbcd658d31ae89f2e53ce73 (diff)
Refactor pve cgit to use generic proxy
This is refactoring the PoC for deploying cgit on pve, to now move to a more standard deployment with dedicated agnonstic proxy role/container
Diffstat (limited to 'roles/cgit/tasks/main.yml')
-rw-r--r--roles/cgit/tasks/main.yml60
1 files changed, 52 insertions, 8 deletions
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml
index fed97fef..17a5675b 100644
--- a/roles/cgit/tasks/main.yml
+++ b/roles/cgit/tasks/main.yml
@@ -4,8 +4,7 @@
ansible.builtin.package:
name:
- cgit
- - nginx
- - fcgiwrap
+ - lighttpd
- openssh
state: present
@@ -43,15 +42,61 @@
group: "root"
mode: "0644"
-- name: "Deploy nginx config"
+- name: "Deploy lighttpd config"
become: true
ansible.builtin.template:
- src: "cgit.nginx.conf.j2"
- dest: "/etc/nginx/http.d/cgit.conf"
+ src: "cgit.lighttpd.conf.j2"
+ dest: "/etc/lighttpd/lighttpd.conf"
owner: "root"
group: "root"
mode: "0644"
- notify: "Restart nginx"
+ notify: "Restart lighttpd"
+
+- name: "Deploy caddy vhost on proxy"
+ when: hostvars[cgit_proxy_host]['proxy_type'] == "caddy"
+ delegate_to: "{{ cgit_proxy_host }}"
+ block:
+ - name: "Ensure caddy sites directory exists"
+ become: true
+ ansible.builtin.file:
+ path: "/etc/caddy/sites"
+ state: directory
+ owner: "root"
+ group: "caddy"
+ mode: "0750"
+
+ - name: "Deploy caddy vhost"
+ become: true
+ ansible.builtin.template:
+ src: "cgit.caddy.j2"
+ dest: "/etc/caddy/sites/{{ cgit_hostname }}.caddy"
+ owner: "root"
+ group: "caddy"
+ mode: "0640"
+ notify: "Restart caddy"
+
+- name: "Deploy nginx vhost on proxy"
+ when: hostvars[cgit_proxy_host]['proxy_type'] == "nginx"
+ delegate_to: "{{ cgit_proxy_host }}"
+ block:
+ - name: "Ensure nginx vhosts directory exists"
+ become: true
+ ansible.builtin.file:
+ path: "/etc/nginx/vhosts.d"
+ state: directory
+ owner: "root"
+ group: "root"
+ mode: "0755"
+
+ - name: "Deploy nginx vhost"
+ become: true
+ ansible.builtin.template:
+ src: "cgit.nginx.conf.j2"
+ dest: "/etc/nginx/vhosts.d/{{ cgit_hostname }}.conf"
+ owner: "root"
+ group: "root"
+ mode: "0644"
+ notify: "Restart nginx"
- name: "Enable and start services"
become: true
@@ -60,6 +105,5 @@
enabled: true
state: started
loop:
- - nginx
- - fcgiwrap
+ - lighttpd
- sshd