ctucx.git: ansible-configs

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

commit 8070db49ac9c6865f6d22775834013d6feb6d989
parent 778dac449c8014c33fc2aa0cde0f512a80178c60
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 21 Feb 2021 16:24:21 +0100

Check that nginx role is enabled when using nginx options of a service
11 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml
@@ -12,6 +12,11 @@
     - services.cgit.enable is true
     - services.cgit.configFile is not defined 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.cgit.nginx.enable is true
+    - services.nginx.enable is false
+
 
 # install it 
 
diff --git a/roles/frp/tasks/frps_checks.yml b/roles/frp/tasks/frps_checks.yml
@@ -17,7 +17,10 @@
     - services.frps.vhostPort is not defined
 
 
-
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.frps.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.frps.nginx.vhosts' has to be set when using nginx!"
   when:
diff --git a/roles/grafana/tasks/checks.yml b/roles/grafana/tasks/checks.yml
@@ -4,6 +4,10 @@
   when:
     - services.grafana.configFile is not defined
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.grafana.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.grafana.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/oeffi-web/tasks/main.yml b/roles/oeffi-web/tasks/main.yml
@@ -20,6 +20,11 @@
     - services.oeffi_web.enable is true
     - services.oeffi_web.instances is not defined 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.oeffi_web.nginx.enable is true
+    - services.nginx.enable is false
+
 
 # install it 
 
diff --git a/roles/oeffisearch/tasks/main.yml b/roles/oeffisearch/tasks/main.yml
@@ -19,6 +19,11 @@
     - services.oeffisearch.enable is true
     - services.oeffisearch.instances is not defined 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.oeffisearch.nginx.enable is true
+    - services.nginx.enable is false
+
 
 # install it 
 
diff --git a/roles/pleroma/tasks/checks.yml b/roles/pleroma/tasks/checks.yml
@@ -22,6 +22,10 @@
   when:
     - services.pleroma.secretsContent is not defined 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.pleroma.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.pleroma.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/prometheus/tasks/checks.yml b/roles/prometheus/tasks/checks.yml
@@ -4,6 +4,10 @@
   when:
     - services.prometheus.config is not defined
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.prometheus.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.prometheus.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/radicale/tasks/checks.yml b/roles/radicale/tasks/checks.yml
@@ -12,6 +12,10 @@
     - services.radicale.configFile is not defined
 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.radicale.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.radicale.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/rest-server/tasks/checks.yml b/roles/rest-server/tasks/checks.yml
@@ -15,6 +15,10 @@
 
 #todo: check that user exists
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.rest_server.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.rest_server.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/synapse/tasks/checks.yml b/roles/synapse/tasks/checks.yml
@@ -19,6 +19,10 @@
     - services.synapse.webClient.configFile is not defined
 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.synapse.nginx.enable is true
+    - services.nginx.enable is false
 
 - fail: msg="Option 'services.synapse.nginx.domain' has to be set when using nginx!"
   when:
diff --git a/roles/syncthing/tasks/checks.yml b/roles/syncthing/tasks/checks.yml
@@ -7,6 +7,11 @@
 #todo: check that user exists
 
 
+- fail: msg="Nginx role has to be enabled when using nginx options!"
+  when:
+    - services.syncthing.nginx.enable is true
+    - services.nginx.enable is false
+
 - fail: msg="Option 'services.syncthing.nginx.domain' has to be set when using nginx!"
   when:
     - services.syncthing.nginx.enable is defined