feat: new variable nbde_client_secure_logging defaulting to true#257
Merged
Conversation
- Replace literal no_log: true with nbde_client_secure_logging variable
- Add no_log: "{{ ansible_verbosity < 2 }}" to service_facts
- Add nbde_client_secure_logging: true to defaults/main.yml
- Document nbde_client_secure_logging variable in README.md
This change allows users to control logging of potentially sensitive
information by setting nbde_client_secure_logging: false for debugging,
while maintaining secure defaults.
For service_facts, the role now uses verbosity-based logging to hide
verbose output unless ansible_verbosity >= 2.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a configurable secure-logging toggle and verbosity-based logging behavior so that sensitive nbde_client tasks can be debugged when needed while keeping safe defaults, and documents the new variable. Class diagram for nbde_client secure logging configuration and tasksclassDiagram
class NbdeClientRole {
bool nbde_client_early_boot
list nbde_client_bindings
bool nbde_client_secure_logging
}
class ServiceFactsTask {
bool no_log
+run(ansible_verbosity)
}
class ClevisCheckTask {
bool no_log
+run(bindings, nbde_client_secure_logging)
}
class ClevisPrepareKeyFilesTask {
bool no_log
+run(bindings, nbde_client_secure_logging)
}
class ClevisOperationsTask {
bool no_log
+run(bindings, data_dir, nbde_client_secure_logging)
}
NbdeClientRole --> ServiceFactsTask : configures
NbdeClientRole --> ClevisCheckTask : configures
NbdeClientRole --> ClevisPrepareKeyFilesTask : configures
NbdeClientRole --> ClevisOperationsTask : configures
ServiceFactsTask : no_log = ansible_verbosity < 2
ClevisCheckTask : no_log = nbde_client_secure_logging
ClevisPrepareKeyFilesTask : no_log = nbde_client_secure_logging
ClevisOperationsTask : no_log = nbde_client_secure_logging
Flow diagram for secure logging and verbosity-based no_log behaviorflowchart TD
Start(["Run nbde_client role"]) --> CheckSecureLogging
CheckSecureLogging["Read nbde_client_secure_logging (default true)"] -->|true| SecureLoggingOn
CheckSecureLogging -->|false| SecureLoggingOff
SecureLoggingOn["Secure logging enabled"] --> SensitiveTasksNoLog
SecureLoggingOff["Secure logging disabled for debugging"] --> SensitiveTasksLog
SensitiveTasksNoLog["Sensitive tasks use no_log: nbde_client_secure_logging (true)"] --> EndSensitive
SensitiveTasksLog["Sensitive tasks use no_log: nbde_client_secure_logging (false)"] --> EndSensitive
subgraph ServiceFactsNoLogControl["service_facts logging control"]
A["Invoke service_facts"] --> CheckVerbosity
CheckVerbosity["Evaluate ansible_verbosity < 2"] -->|true| HideServiceFacts
CheckVerbosity -->|false| ShowServiceFacts
HideServiceFacts["no_log: ansible_verbosity < 2 (true) hides verbose output"]
ShowServiceFacts["no_log: ansible_verbosity < 2 (false) shows detailed facts"]
end
Start --> ServiceFactsNoLogControl --> CheckSecureLogging
EndSensitive(["Role completes with configured logging behavior"])
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
richm
approved these changes
May 7, 2026
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.
Feature: Introduce the
nbde_client_secure_loggingvariable that defaults totrueand using verbosity-based logging for facts modules.Reason: Currently, all sensitive tasks use hard-coded no_log: true, which makes debugging difficult. Users cannot see credential-related output even when troubleshooting authentication or secret management issues. Additionally, service_facts produces verbose output that clutters logs during normal operation.
Result:
🤖 Generated with Claude Code
Summary by Sourcery
Introduce configurable secure logging for NBDE client tasks and adjust service facts logging based on Ansible verbosity.
New Features:
Enhancements:
Documentation: