Description
SUMMARY
Current implementation of dnf
module diverges from the one of other similar packaging modules by failing to rely solely on the msg
return value.
Module also returns critical information inside undocumented failures: []
value, something for which we were unable to identify any other module.
ISSUE TYPE
- Bug Report
COMPONENT NAME
dnf
ANSIBLE VERSION
2.10 - anu=y
STEPS TO REPRODUCE
- dnf:
name: not-existing-package
register: result
EXPECTED RESULTS
We do expect to include all needed information inside standardizes keys, like msg
, stderr
and stdout
.
ACTUAL RESULTS
{
"msg": "Failed to install some of the specified packages",
"failures": [
"No package python-docker-py available."
]
}
Especially because the the failures
was always undocumented, changing the module to assure it includes the full list of errors inside msg
should not be seen as a problem.
Example below displays the diverging behavior between apt and dnf modules, which create weird results when used by package
:
fatal: [ubuntu]: FAILED! => changed=false
msg: No package matching 'not-existing-foo' is available
...ignoring
fatal: [centos]: FAILED! => changed=false
failures:
- No package not-existing-foo available.
- No package not-existing-bar available.
msg: Failed to install some of the specified packages
rc: 1
results: []
If failures
is there by greater design, it should be documented and also mentioned in documentation for module developers, so others can make use of it.