network/tasks/set_facts.yml
Sergei Petrosian 313f3ea4ec 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>
2026-05-12 07:18:48 -06:00

35 lines
1.1 KiB
YAML

# SPDX-License-Identifier: BSD-3-Clause
---
- name: Ensure ansible_facts used by role are present
setup:
gather_subset: "{{ __network_required_facts_subsets }}"
when: __network_required_facts |
difference(ansible_facts.keys() | list) | length > 0
no_log: "{{ ansible_verbosity < 3 }}"
- name: Record role begin fingerprint
sr_fingerprint:
sr_message: >-
begin system_role:network ansible_version={{ ansible_version.full }}
{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}
- name: Determine if system is ostree and set flag
when: not __network_is_ostree is defined
block:
- name: Check if system is ostree
stat:
path: /run/ostree-booted
register: __ostree_booted_stat
- name: Set flag to indicate system is ostree
set_fact:
__network_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"
- name: Check which services are running
service_facts:
no_log: "{{ ansible_verbosity < 3 }}"
# needed for ansible_facts.packages
- name: Check which packages are installed
package_facts:
no_log: "{{ ansible_verbosity < 3 }}"