-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added assertion to check sugroup exists
Signed-off-by: Mark Bolwell <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,26 @@ | |
- rhel7cis_set_boot_pass | ||
- rhel7cis_rule_1_5_1 | ||
|
||
- name: "check sugroup exists if used" | ||
block: | ||
- name: "Check su group exists if defined" | ||
command: grep -w "{{ rhel7cis_sugroup }}" /etc/group | ||
register: sugroup_exists | ||
changed_when: false | ||
failed_when: sugroup_exists.rc >= 2 | ||
tags: | ||
- skip_ansible_lint | ||
|
||
- name: Check sugroup if defined exists before continuing | ||
assert: | ||
that: sugroup_exists.rc == '0' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
shk3bq4d
|
||
msg: "The variable rhel7cis_sugroup is defined but does not exist please rectify" | ||
when: | ||
- rhel7cis_sugroup is defined | ||
- rhel7cis_rule_5_6 | ||
tags: | ||
- rule_5.6 | ||
|
||
- include: check_prereqs.yml | ||
tags: | ||
- always | ||
|
I believe you should remove the single quotes around zero