You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to install (a) package(s) using the zypper module on SLE Micro, transactional-update is used but even if the command fails, the task is marked OK and the play continues as if everything is alright.
It seems that transactional-update returns a 0 as returncode and Ansible then assumes everything is ok. Actual error messages of transactional-update are ignored.
NAME="SLE Micro"VERSION="5.5"VERSION_ID="5.5"PRETTY_NAME="SUSE Linux Enterprise Micro 5.5"ID="sle-micro"ID_LIKE="suse"ANSI_COLOR="0;32"CPE_NAME="cpe:/o:suse:sle-micro:5.5"
Steps to Reproduce
On target machine the packages wget and vim need to be installed. However the target is missing the repositories with those packages are in, so the task should fail as the packages to be installed are not to be found by the package manager.
- name: Install packagescommunity.general.zypper:
name:
- wget
- vim
Expected Results
I expected the task to fail with error
No provider of "+vim" foundNo provider of "+wget" found.
And then the next task in the play is started assuming the required packages are installed.
Manually running the transactional-update command on the target machine gives this:
# /usr/sbin/transactional-update --continue --drop-if-no-change --quiet run /usr/bin/zypper --quiet --non-interactive --xmlout install --type package --auto-agree-with-licenses --no-recommends -- +wget +vim;echo rc=$?<?xml version='1.0'?><stream><message type="error">No provider of '+vim' found.</message><message type="error">No provider of '+wget' found.</message></stream>rc=0
So return code is 0 but the output indicates that the packages are not installed and are in fact not found.
I assume community.general.zypper assumes success when rc=0, but I think it should check the output of the command for <message type="error"> instead of relying on the RC only.
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
Summary
When I try to install (a) package(s) using the zypper module on SLE Micro, transactional-update is used but even if the command fails, the task is marked OK and the play continues as if everything is alright.
It seems that transactional-update returns a 0 as returncode and Ansible then assumes everything is ok. Actual error messages of transactional-update are ignored.
Issue Type
Bug Report
Component Name
zypper
Ansible Version
Community.general Version
Configuration
OS / Environment
Steps to Reproduce
On target machine the packages wget and vim need to be installed. However the target is missing the repositories with those packages are in, so the task should fail as the packages to be installed are not to be found by the package manager.
Expected Results
I expected the task to fail with error
Actual Results
Task details:
And then the next task in the play is started assuming the required packages are installed.
Manually running the transactional-update command on the target machine gives this:
So return code is 0 but the output indicates that the packages are not installed and are in fact not found.
I assume community.general.zypper assumes success when rc=0, but I think it should check the output of the command for
<message type="error">
instead of relying on the RC only.Code of Conduct
The text was updated successfully, but these errors were encountered: