From 9c414501fe0cfefcd7df9ff56d92b9c662e531a1 Mon Sep 17 00:00:00 2001 From: Mark Bolwell Date: Tue, 8 Mar 2022 16:21:24 +0000 Subject: [PATCH] ability to skip supported os check Signed-off-by: Mark Bolwell --- README.md | 5 +++-- defaults/main.yml | 3 +++ tasks/main.yml | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 307474c2..9c69ebaa 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,9 @@ Refer to [RHEL8-STIG-Audit](https://github.com/ansible-lockdown/RHEL8-STIG-Audit ## Requirements -RHEL/Rocky/AlmaLinux 8 - Other versions are not supported. -Access to download or add the goss binary and content to the system if using auditing. options are available on how to get the content to the system. +- RHEL/Rocky/AlmaLinux 8 - Other versions are not supported. +- Other OSs can be checked by changing the skip_os_check to true for testing purposes. +- Access to download or add the goss binary and content to the system if using auditing. options are available on how to get the content to the system. ### General diff --git a/defaults/main.yml b/defaults/main.yml index dc2c9d1c..c740213b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,6 +9,9 @@ benchmark: RHEL8-STIG # Whether to skip the reboot rhel8cis_skip_reboot: true +# Whether to skip the OS check for supported OS's +skip_os_check: false + rhel8stig_cat1_patch: true rhel8stig_cat2_patch: true rhel8stig_cat3_patch: true diff --git a/tasks/main.yml b/tasks/main.yml index d1fae8af..695a1aee 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,6 +13,8 @@ that: (ansible_distribution != 'CentOS' and ansible_os_family == 'RedHat' or ansible_os_family == "Rocky") and ansible_distribution_major_version is version_compare('8', '==') fail_msg: "This role can only be run against RHEL/Rocky 8. {{ ansible_distribution }} {{ ansible_distribution_major_version }} is not supported." success_msg: "This role is running against a supported OS {{ ansible_distribution }} {{ ansible_distribution_major_version }}" + when: + - not skip_os_check tags: - always