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 <noreply@anthropic.com>
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
This commit is contained in:
Sergei Petrosian 2026-05-07 14:44:44 +02:00 committed by Richard Megginson
parent 1552fe866a
commit 313f3ea4ec
2 changed files with 5 additions and 5 deletions

View file

@ -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:

View file

@ -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 }}"