feat: new variable trustee_server_secure_logging defaulting to true#15
Merged
Merged
Conversation
- Replace literal no_log: true with trustee_server_secure_logging variable
- Add no_log: "{{ ansible_verbosity < 2 }}" to service_facts
- Add trustee_server_secure_logging: true to defaults/main.yml
- Document trustee_server_secure_logging variable in README.md
This change allows users to control logging of potentially sensitive
information by setting trustee_server_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 GuideIntroduces a configurable secure logging toggle and verbosity-based logging for service facts to balance sensitive data protection with debug visibility. Flow diagram for trustee_server_secure_logging behavior in sensitive tasksflowchart TD
A[Start sensitive_task] --> B[Evaluate trustee_server_secure_logging]
B -->|true| C[Set no_log true on sensitive_task]
B -->|false| D[Set no_log false on sensitive_task]
C --> E[Run task with sensitive output suppressed]
D --> F[Run task with full output visible]
E --> G[End sensitive_task]
F --> G
Flow diagram for verbosity-based logging of service_factsflowchart TD
A[Start service_facts task] --> B[Check ansible_verbosity]
B -->|ansible_verbosity < 2| C[Set no_log true]
B -->|ansible_verbosity >= 2| D[Set no_log false]
C --> E[Run service_facts with output hidden]
D --> F[Run service_facts with output shown]
E --> G[End service_facts task]
F --> G
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider coercing
trustee_server_secure_loggingto a boolean in theno_logexpression (e.g.no_log: "{{ trustee_server_secure_logging | bool }}") so that string overrides like"false"don’t accidentally evaluate as truthy. - For the
service_factstasks usingno_log: "{{ ansible_verbosity < 2 }}", it may be safer to guard againstansible_verbositybeing undefined by using a default (e.g.no_log: "{{ (ansible_verbosity | default(0)) < 2 }}").
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider coercing `trustee_server_secure_logging` to a boolean in the `no_log` expression (e.g. `no_log: "{{ trustee_server_secure_logging | bool }}"`) so that string overrides like `"false"` don’t accidentally evaluate as truthy.
- For the `service_facts` tasks using `no_log: "{{ ansible_verbosity < 2 }}"`, it may be safer to guard against `ansible_verbosity` being undefined by using a default (e.g. `no_log: "{{ (ansible_verbosity | default(0)) < 2 }}"`).Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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
trustee_server_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 a configurable secure logging toggle for sensitive tasks and adjust service facts logging verbosity to balance security and debuggability.
New Features:
Enhancements: