community.general icon indicating copy to clipboard operation
community.general copied to clipboard

No console output when using zypper/dnf module to install packages

Open Winnie81 opened this issue 5 years ago • 8 comments
trafficstars

SUMMARY

There are no console output when using using zypper/dnf module to install packages.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

zypper, dnf

ANSIBLE VERSION
ansible 2.10.0.dev0
CONFIGURATION

OS / ENVIRONMENT

SLES15, RHEL 8.3, CentOS 8.2, OracleLinux 8.2

STEPS TO REPRODUCE

Use package module to install packages.


EXPECTED RESULTS

When using package module to install packages, we expect to get console output. For RHEL 7.4, we can get below info: ok: [localhost] => {     "tools_install_result": {         "changed": true,          "changes": {             "installed": [                 "open-vm-tools-desktop"             ]         },          "failed": false,          "msg": "",          "rc": 0,          "results": [             "Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-\n              : manager\nThis system is not registered with an entitlement server. You can use subscription-manager to register.\nResolving Dependencies\n--> Running transaction check\n---> Package open-vm-tools-desktop.x86_64 0:10.3.10-2.el7 will be installed\n--> Processing Dependency: open-vm-tools(x86-64) = 10.3.10-2.el7 for package: open-vm-tools-desktop-10.3.10-2.el7.x86_64\n--> Processing Dependency: libvmtools.so.0()(64bit) for package: open-vm-tools-desktop-10.3.10-2.el7.x86_64\n--> Processing Dependency: libhgfs.so.0()(64bit) for package: open-vm-tools-desktop-10.3.10-2.el7.x86_64\n--> Running transaction check\n---> Package open-vm-tools.x86_64 0:10.3.10-2.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package                   Arch       Version            Repository        Size\n================================================================================\nInstalling:\n open-vm-tools-desktop     x86_64     10.3.10-2.el7      rhel-7-extra     170 k\nInstalling for dependencies:\n open-vm-tools             x86_64     10.3.10-2.el7      rhel-7-extra     674 k\n\nTransaction Summary\n================================================================================\nInstall  1 Package (+1 Dependent package)\n\nTotal download size: 843 k\nInstalled size: 2.5 M\nDownloading packages:\n--------------------------------------------------------------------------------\nTotal                                              153 kB/s | 843 kB  00:05     \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : open-vm-tools-10.3.10-2.el7.x86_64                           1/2 \n  Installing : open-vm-tools-desktop-10.3.10-2.el7.x86_64                   2/2 \n  Verifying  : open-vm-tools-desktop-10.3.10-2.el7.x86_64                   1/2 \n  Verifying  : open-vm-tools-10.3.10-2.el7.x86_64                           2/2 \n\nInstalled:\n  open-vm-tools-desktop.x86_64 0:10.3.10-2.el7                                  \n\nDependency Installed:\n  open-vm-tools.x86_64 0:10.3.10-2.el7                                          \n\nComplete!\n"         ]     } } And for Debian, we can get console output from "stdout" or "stdout_lines". But for other OSes, such as SLES15, RHEL 8.3, CentOS 8.2, OracleLinux 8.2, we can't get those info.

ACTUAL RESULTS

Using package module to install open vmware tools in RHEL8, we get below info:

ok: [localhost] => {
    "tools_install_result": {
        "changed": true, 
        "failed": false, 
        "msg": "", 
        "rc": 0, 
        "results": [
            "Installed: open-vm-tools", 
            "Installed: xmlsec1-openssl-1.2.25-4.el8.x86_64", 
            "Installed: libmspack-0.7-0.3.alpha.el8.4.x86_64", 
            "Installed: open-vm-tools-11.1.0-1.el8.x86_64", 
            "Installed: xmlsec1-1.2.25-4.el8.x86_64"
        ]
    }
}
Similar for CentOS 8.2 and OracleLinux 8.2

Winnie81 avatar Jul 23 '20 08:07 Winnie81

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Jul 23 '20 08:07 ansibullbot

cc @AnderEnder @alxgu @andytom @commel @dcermak @evrardjp @lrupp @toabctl click here for bot help

ansibullbot avatar Jul 23 '20 08:07 ansibullbot

Is there a reference somewhere that guarantees that there will be console output? If not, this is not a bug, but a feature request.

felixfontein avatar Jul 23 '20 10:07 felixfontein

Is there a reference somewhere that guarantees that there will be console output? If not, this is not a bug, but a feature request.

Yes, it's better for our application to contain console output.

Winnie81 avatar Jul 24 '20 06:07 Winnie81

Well, I am not even sure this is something we want to provide. For me, the result should only keep the solver results (installed and removed packages).

If people want to see the logs they could either use a shell/command task, or read the logs from /var/log/zypper.log. What could be interesting though would be to add a "debug" flag, which either triggers the addition of a debug solver flag in the command or captures the full output.

To rephrase my opinion: I am not against this feature, but I don't see its interest either. I won't block that feature request, and I can even help you! ... so feel free to propose a change. Anyone welcome to help. :)

evrardjp avatar Aug 05 '20 11:08 evrardjp

There are no console output when using using zypper/dnf module to install packages.

should there be console output at all in the first place?

ansible is not a shell script, but automation framework/engine... look for sample output from other ansible tasks, do they provide extensive logs when doing (simple or not) tasks?

thanks

mator avatar Oct 23 '20 10:10 mator

cc @sealor click here for bot help

ansibullbot avatar Sep 28 '21 20:09 ansibullbot

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Nov 11 '22 02:11 ansibullbot