From e6fd30f3db11367ea3935c48d2bba5ce3e9ff53c Mon Sep 17 00:00:00 2001 From: Chris Croome <chris@webarchitects.co.uk> Date: Mon, 27 Jan 2020 17:05:06 +0000 Subject: [PATCH] checks --- tasks/checks.yml | 57 +++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/tasks/checks.yml b/tasks/checks.yml index 33b8fdc..2d687bd 100644 --- a/tasks/checks.yml +++ b/tasks/checks.yml @@ -44,13 +44,13 @@ - name: apache_mods_enabled and apache_mods_disabled array checks block: - - name: Debug mod arrays + - name: Debug mod arrays debug: var: - apache_mods_enabled - apache_mods_disbled verbosity: 2 - + - name: Check that no mods are enabled and disabled assert: that: mod not in apache_mods_disabled @@ -58,7 +58,7 @@ loop_control: loop_var: mod label: "{{ mod }}" - + - name: Check that no mods are disabled and enabled assert: that: mod not in apache_mods_enabled @@ -74,7 +74,7 @@ - name: apache_conf_enabled and apache_conf_disabled array checks block: - - name: Debug conf arrays + - name: Debug conf arrays debug: var: - apache_conf_enabled @@ -84,15 +84,15 @@ - name: Check that no conf are enabled and disabled assert: that: conf not in apache_conf_disabled - loop: apache_conf_enabled + loop: "{{ apache_conf_enabled }}" loop_control: loop_var: conf label: "{{ conf }}" - + - name: Check that no conf are disabled and enabled assert: that: conf not in apache_conf_enabled - loop: apache_conf_disabled + loop: "{{ apache_conf_disabled }}" loop_control: loop_var: conf label: "{{ conf }}" @@ -101,23 +101,34 @@ - ( apache_conf_enabled is defined ) and ( apache_conf_enabled[0] is defined ) - ( apache_conf_disabled is defined ) and ( apache_conf_disabled[0] is defined ) - - name: Check that no sites are enabled and disabled - assert: - that: site not in apache_sites_disabled - loop: apache_sites_enabled - loop_control: - loop_var: site - label: "{{ site }}" - when: apache_sites_enabled[0] is defined + - name: apache_sites_enabled and apache_sites_disabled array checks - - name: Check that no sites are disabled and enabled - assert: - that: site not in apache_sites_enabled - loop: apache_sites_disabled - loop_control: - loop_var: site - label: "{{ site }}" - when: apache_sites_disabled[0] is defined + - name: Debug site arrays + debug: + var: + - apache_sites_enabled + - apache_sites_disbled + verbosity: 2 + + - name: Check that no sites are enabled and disabled + assert: + that: site not in apache_sites_disabled + loop: "{{ apache_sites_enabled }}" + loop_control: + loop_var: site + label: "{{ site }}" + + - name: Check that no sites are disabled and enabled + assert: + that: site not in apache_sites_enabled + loop: "{{ apache_sites_disabled }}" + loop_control: + loop_var: site + label: "{{ site }}" + + when: + - ( apache_sites_enabled is defined ) and ( apache_sites_enabled[0] is defined ) + - ( apache_sites_disabled is defined ) and ( apache_sites_disabled[0] is defined ) - name: Check the Apache version, modules and conf, loaded and enabled block: -- GitLab