diff --git a/tests/set_selinux_variables.yml b/tests/set_selinux_variables.yml index 884fe3c..f2d2584 100644 --- a/tests/set_selinux_variables.yml +++ b/tests/set_selinux_variables.yml @@ -11,8 +11,8 @@ - name: Ensure ansible_facts used by tests setup: gather_subset: min - when: not ansible_facts.keys() | list | - intersect(__selinux_test_facts) == __selinux_test_facts + when: __selinux_test_facts | + difference(ansible_facts.keys() | list) | length > 0 - name: Ensure SELinux testing packages include_role: @@ -37,6 +37,11 @@ else 'util-linux' if ansible_facts['os_family'] == 'RedHat' else 'util-linux' }}" + - name: Set is_el6 flag + set_fact: + __selinux_is_el6: "{{ ansible_facts['os_family'] == 'RedHat' and + ansible_facts['distribution_major_version'] is version('7', '<') }}" + - name: Get test facts when: __selinux_get_test_facts | d(true) block: diff --git a/tests/tests_modifications_with_selinux_disabled.yml b/tests/tests_modifications_with_selinux_disabled.yml index abc2038..519f844 100644 --- a/tests/tests_modifications_with_selinux_disabled.yml +++ b/tests/tests_modifications_with_selinux_disabled.yml @@ -15,6 +15,10 @@ __selinux_need_policy_targeted: true __selinux_need_findmnt: true + - name: Skip test on EL6 + meta: end_host + when: __selinux_is_el6 | d(false) + - name: Add a Linux System Roles SELinux User user: comment: Linux System Roles SELinux User