From 313f3ea4ec235fa219d758572863b9452b752f72 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Thu, 7 May 2026 14:44:44 +0200 Subject: [PATCH] feat: Use verbosity-based logging in network role - Replace no_log: true with no_log: "{{ ansible_verbosity < 3 }}" in all tasks (setup, service_facts, package_facts, and service tasks) - This allows output to be shown when running with -vvv or higher verbosity - The no_log was used for verbosity control, not security purposes In the network role, no_log: true was used to reduce verbose output, not to protect sensitive information. Using ansible_verbosity allows users to see the output when debugging with increased verbosity flags. Co-Authored-By: Claude Sonnet 4.5 Signed-off-by: Sergei Petrosian --- tasks/main.yml | 4 ++-- tasks/set_facts.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index bcad966..2566696 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -157,7 +157,7 @@ enabled: true when: - network_provider == "nm" or network_state != {} - no_log: true + no_log: "{{ ansible_verbosity < 3 }}" # If any 802.1x connections are used, the wpa_supplicant # service is required to be running @@ -176,7 +176,7 @@ enabled: true when: - network_provider == "initscripts" - no_log: true + no_log: "{{ ansible_verbosity < 3 }}" - name: Ensure initscripts network file dependency is present copy: diff --git a/tasks/set_facts.yml b/tasks/set_facts.yml index 6ad4e40..35a998d 100644 --- a/tasks/set_facts.yml +++ b/tasks/set_facts.yml @@ -5,7 +5,7 @@ gather_subset: "{{ __network_required_facts_subsets }}" when: __network_required_facts | difference(ansible_facts.keys() | list) | length > 0 - no_log: true + no_log: "{{ ansible_verbosity < 3 }}" - name: Record role begin fingerprint sr_fingerprint: @@ -27,9 +27,9 @@ - name: Check which services are running service_facts: - no_log: true + no_log: "{{ ansible_verbosity < 3 }}" # needed for ansible_facts.packages - name: Check which packages are installed package_facts: - no_log: true + no_log: "{{ ansible_verbosity < 3 }}"