package_facts module does not update packages host facts with apk when cache is empty or network unreacheable #83126
Labels
affects_2.16
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
module
This issue/PR relates to a module.
Summary
When running module package_facts on an offline (or with deleted cache) system using apk as package manager (Alpine Linux 3.19.1), the
packages
dictionnary is not populated because a warning is printed on thestderr
output, even if the return code is0
.On the target system, the following command help me figure out why:
I believe this is due to the check for
err
on line 443 of the package_facts module:The following Exception can be printed:
Issue Type
Bug Report
Component Name
package_facts
Ansible Version
Configuration
OS / Environment
Target OS : Alpine Linux 3.19.1
Steps to Reproduce
Expected Results
Results obtained when replacing
if rc != 0 or err:
withif rc != 0:
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: