ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 593757b9bf9dd733314f17e52d2494bb9ce6bf5c
parent 6935d9926b70ab6c9f4dc111c70ded56fab63708
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 6 Mar 2021 00:01:56 +0100

roles/nginx: add support for nginx-mod-http-xslt-filter
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml
@@ -2,7 +2,8 @@
 
 - name: "[Alpine] Install package: nginx" 
   apk:
-    name: nginx
+    name:
+      - nginx
     state: present
   when:
     - ansible_distribution == "Alpine" 

@@ -13,3 +14,20 @@
     state: present
   when:
     - ansible_distribution == "Archlinux" 
+
+- name: "[Alpine] Install package: nginx-mod-http-xslt-filter" 
+  apk:
+    name: nginx-mod-http-xslt-filter
+    state: present
+  when:
+    - ansible_distribution == "Alpine"
+    - services.nginx.enableXSLTFilter is true
+
+- name: "[Archlinux] Install package: nginx-mod-http-xslt-filter" 
+  pacman:
+    name: nginx-mod-http-xslt-filter
+    state: present
+  when:
+    - ansible_distribution == "Archlinux"
+    - services.nginx.enableXSLTFilter is true
+
diff --git a/roles/nginx/templates/nginx.conf.j2 b/roles/nginx/templates/nginx.conf.j2
@@ -10,8 +10,9 @@ pcre_jit on;
 
 error_log /var/log/nginx/error.log warn;
 
-include /etc/nginx/modules/*.conf;
-
+{% if services.nginx.enableXSLTFilter is true %}
+load_module "/usr/lib/nginx/modules/ngx_http_xslt_filter_module.so";
+{% endif %}
 
 events {
 	worker_connections 1024;
diff --git a/roles/nginx/templates/vhost.conf.j2 b/roles/nginx/templates/vhost.conf.j2
@@ -75,7 +75,7 @@ server {
 	listen 443 ssl default_server;
 	listen [::]:443 ssl default_server;
 	{% else %}
-	listen 443 ssl ;
+	listen 443 ssl;
 	listen [::]:443 ssl;
 	{% endif %}