aboutsummaryrefslogtreecommitdiff
path: root/roles/git
diff options
context:
space:
mode:
authorRoman Ilin <me@romanilin.is>2026-06-15 12:59:09 +0300
committerRoman Ilin <me@romanilin.is>2026-06-15 22:04:41 +0300
commit5e4bf1268c266e63d0e92e845ad910a2103b86ff (patch)
tree532c01a9658a05048ef1ba76d4f30fca84005643 /roles/git
downloadinfrastructure-main.tar.gz
Diffstat (limited to 'roles/git')
-rw-r--r--roles/git/handlers/main.yaml7
-rw-r--r--roles/git/tasks/main.yaml22
-rw-r--r--roles/git/templates/git_nginx.conf.j216
3 files changed, 45 insertions, 0 deletions
diff --git a/roles/git/handlers/main.yaml b/roles/git/handlers/main.yaml
new file mode 100644
index 0000000..3503da0
--- /dev/null
+++ b/roles/git/handlers/main.yaml
@@ -0,0 +1,7 @@
+- name: Restart Git Services
+ ansible.builtin.systemd:
+ name: "{{ item }}"
+ state: restarted
+ loop:
+ - nginx
+ - fcgiwrap@nginx.socket
diff --git a/roles/git/tasks/main.yaml b/roles/git/tasks/main.yaml
new file mode 100644
index 0000000..b80989e
--- /dev/null
+++ b/roles/git/tasks/main.yaml
@@ -0,0 +1,22 @@
+- name: Install Git, Nginx, and Fcgiwrap
+ ansible.builtin.dnf:
+ name:
+ - cgit
+ - nginx
+ - fcgiwrap
+ state: present
+
+- name: Deploy Git Nginx configuration
+ ansible.builtin.template:
+ src: git_nginx.conf.j2
+ dest: /etc/nginx/conf.d/default.conf
+ notify: Restart Git Services
+
+- name: Ensure Git Web Services are Enabled and Running
+ ansible.builtin.systemd:
+ name: "{{ item }}"
+ state: started
+ enabled: yes
+ loop:
+ - nginx
+ - fcgiwrap@nginx.socket
diff --git a/roles/git/templates/git_nginx.conf.j2 b/roles/git/templates/git_nginx.conf.j2
new file mode 100644
index 0000000..cd37f25
--- /dev/null
+++ b/roles/git/templates/git_nginx.conf.j2
@@ -0,0 +1,16 @@
+server {
+ listen 80;
+ server_name _;
+
+ root /usr/share/cgit;
+ try_files $uri @cgit;
+
+ location @cgit {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /var/www/cgi-bin/cgit;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param QUERY_STRING $args;
+ fastcgi_param HTTP_HOST $server_name;
+ fastcgi_pass unix:/run/fcgiwrap-nginx.sock;
+ }
+}