Simplify SELinux check

The ansible_selinux variable is always populated with a 'status'
property, even if SELinux is not installed or configured. This
patch simplifies the check.

Change-Id: Ifddc385fc292ddb7d6c2758b199401c45de0f0f2
Signed-off-by: Major Hayden <major@mhtx.net>
This commit is contained in:
Major Hayden 2018-03-06 13:17:43 -06:00
parent d0f837a049
commit fcad8c23f5
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1
1 changed files with 1 additions and 2 deletions

View File

@ -111,8 +111,7 @@
check_mode: no
when:
- ansible_os_family == 'RedHat'
- ansible_selinux.status is defined
- ansible_selinux.status != 'disabled'
- ansible_selinux.status == 'enabled'
tags:
- lsm
- medium