From a7f896c522e7910321c07ca8306e308fdb9a6cd1 Mon Sep 17 00:00:00 2001
From: Chris Croome <chris@webarchitects.co.uk>
Date: Mon, 27 Jan 2020 16:18:22 +0000
Subject: [PATCH] checks added

---
 tasks/checks.yml | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tasks/checks.yml b/tasks/checks.yml
index 89920dc..8a5f5e7 100644
--- a/tasks/checks.yml
+++ b/tasks/checks.yml
@@ -1,5 +1,5 @@
 ---
-- name: Check that only one of mpm_prefork or mpm_events is enabled or disabled
+- name: Check that mistakes haven't been made in the variables and arrays
   block:
 
     - name: Check that at least one module is in apache_mods_enabled and that either mpm_event or mpm_prefork is enabled
@@ -23,6 +23,24 @@
           - ( "mpm_prefork" not in apache_mods_disabled )
       when: ( "mpm_prefork" in apache_mods_enabled )
 
+    - name: Check that there are no duplicates in the mods arrays
+      assert:
+        that:
+          - apache_mods_enabled | unique | count == apache_mods_enabled | unique
+          - apache_mods_disabled | unique | count == apache_mods_disabled | unique
+
+    - name: Check that there are no duplicates in the conf arrays
+      assert:
+        that:
+          - apache_conf_enabled | unique | count == apache_conf_enabled | unique
+          - apache_conf_disabled | unique | count == apache_conf_disabled | unique
+
+    - name: Check that there are no duplicates in the sites arrays
+      assert:
+        that:
+          - apache_sites_enabled | unique | count == apache_sites_enabled | unique
+          - apache_sites_disabled | unique | count == apache_sites_disabled | unique
+
 - name: Check the Apache version, modules and conf, loaded and enabled
   block:
 
-- 
GitLab