fix(tasks): correct mount audit logic and variable naming in section 1#333
Open
teebee wants to merge 1 commit intoansible-lockdown:develfrom
Open
fix(tasks): correct mount audit logic and variable naming in section 1#333teebee wants to merge 1 commit intoansible-lockdown:develfrom
teebee wants to merge 1 commit intoansible-lockdown:develfrom
Conversation
Fixed copy-paste errors where tasks referenced incorrect mount variables. Updated logic from 'is undefined' to '.rc != 0' to ensure audit warnings are correctly triggered when partitions are missing, as 'register' always defines the variable. Signed-off-by: teebee <733833@gmx.de>
|
Congrats on opening your first pull request and thank you for taking the time to help improve Ansible-Lockdown! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overall Review of Changes:
This PR corrects critical logical errors and variable naming inconsistencies in the partition audit tasks of Section 1 (Benchmarks
1.1.2.1.xthrough1.1.2.7.x)./homeand/varincorrectly referenceddiscovered_dev_shm_mountinstead of their own registered variables.is undefinedto.rc != 0. Since the precedingcommandtask usesregister, the variable is always defined, which previously caused the audit warnings to be skipped entirely.Issue Fixes:
N/A (Found during manual code review and verified via testing)
Enhancements:
warn_control_list.How has this been tested?:
Verified using a dedicated test playbook on an Ubuntu 22.04 VM.
findmntreturns RC 1, and the new.rc != 0logic correctly triggers the warning and includes it in thewarning_factssummary..rc == 0.