Bug 2100558

Summary: sshd role should support running tests with ANSIBLE_GATHERING=explicit
Product: Red Hat Enterprise Linux 9 Reporter: Rich Megginson <rmeggins>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED MIGRATED QA Contact: Bob Fubel <bfubel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: bfubel, rhel-cs-system-management-subsystem-qe, spetrosi
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: 9.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:sshd
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2078999
: 2100559 (view as bug list) Environment:
Last Closed: 2023-09-12 10:03:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2078989, 2078999, 2079008    
Bug Blocks: 2079009, 2100559, 2162788    

Description Rich Megginson 2022-06-23 17:18:27 UTC
+++ This bug was initially created as a clone of Bug #2078999 +++

+++ This bug was initially created as a clone of Bug #2078989 +++

Description of problem:
Some users use `gather_facts: false` in their playbooks, due to performance issues with fact gathering, or other reasons.  However, this breaks the metrics role because it requires some sort of facts like `os_family`, `distribution`, etc. to be defined.  The role should work if fact gathering is disabled in the playbook.

NOTE: This may require the user to enable fact caching, or simply not use the metrics role if it is not possible to use fact gathering at all.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Rich Megginson on 2022-04-26 16:41:29 UTC ---

Ansible by default will always gather facts in playbooks.  In order to test, you can use https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-gathering to disable fact gathering by default.

e.g. 

ANSIBLE_GATHERING=explicit ansible-playbook .... tests/tests_name.yml


Even though the sshd role should support being run with "gather_facts: false" in the playbook, almost all of the tests fail when using ANSIBLE_GATHERING=explicit, so it is difficult to verify that the role is indeed working with fact gathering disabled.

If we change all of the tests that fail to use "gather_facts: true", then the tests pass, but we have then masked the problem, and we are not actually verifying that the role will work when customers use "gather_facts: false" in their playbooks.

I guess the best we can do is ensure that there are at least some non-trivial sshd role tests that can be run with ANSIBLE_GATHERING=explicit that do not just use "gather_facts: true" inside the test.

Comment 1 Bob Fubel 2023-03-09 14:35:15 UTC
Richard, I am picking up the network roles testing from Jon Trossbach.  

Could you let me know what playbooks I should run for this bug https://bugzilla.redhat.com/show_bug.cgi?id=2100558 once it's ready

Comment 2 Rich Megginson 2023-03-09 14:54:37 UTC
(In reply to Bob Fubel from comment #1)
> Richard, I am picking up the network roles testing from Jon Trossbach.  
> 
> Could you let me know what playbooks I should run for this bug
> https://bugzilla.redhat.com/show_bug.cgi?id=2100558 once it's ready

You would run all of test playbooks for the role.

If you are new to Ansible and system roles, we should set up a meeting with system roles QE to onboard you.

Comment 5 RHEL Program Management 2023-09-12 09:58:06 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 6 RHEL Program Management 2023-09-12 10:03:30 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.