Dear all,
the zypper module (and thus the package module) is no longer working
on my openSUSE Leap 42.1 / 42.2 or Tumbleweed machines, since zypper
does not like being called with --dry-run in check_mode:
fatal: [XXX]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper",
"--quiet", "--non-interactive", "--xmlout", "refresh", "--dry-run"],
"failed": true, "msg": "Zypper run command failed with return code
2.", "rc": 2, "stderr": "Unbekannte Option'--dry-run'\n", "stdout":
"<?xml version='1.0'?>\n<stream>\n</stream>\n", "stdout_lines":
["<?xml version='1.0'?>", "<stream>", "</stream>"]}
The same task works without flaws when not in check_mode.
I have tested ansible 2.2 on both a linux and OSX machine with the
same result.
The machines in question have the following versions of *zypp* installed:
10 janvier 2017 12:12 "Johannes Kastl" <mail@ojkastl.de> a écrit:
Dear all,
the zypper module (and thus the package module) is no longer working
on my openSUSE Leap 42.1 / 42.2 or Tumbleweed machines, since zypper
does not like being called with --dry-run in check_mode:
fatal: [XXX]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper",
"--quiet", "--non-interactive", "--xmlout", "refresh", "--dry-run"],
"failed": true, "msg": "Zypper run command failed with return code
2.", "rc": 2, "stderr": "Unbekannte Option'--dry-run'\n", "stdout":
"<?xml version='1.0'?>\n<stream>\n</stream>\n", "stdout_lines":
["<?xml version='1.0'?>", "<stream>", "</stream>"]}
Because some part of your error is in German... At a guess, perhaps you should try to
set these variables to ansible.cfg, it saved my life with some other modules (I'm french and some server are in Frenche)
module_lang = C
module_set_locale = True
If it solved your problem, you should open a bug report
Regards,
JYL
Hi,
thanks for your answer.
Because some part of your error is in German...
This is just because the error messages are displayed in another
locale, but there are still error messages:
fatal: [XXX]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper",
"--quiet", "--non-interactive", "--xmlout", "refresh", "--dry-run"],
"failed": true, "msg": "Zypper run command failed with return code
2.", "rc": 2, "stderr": "Unknown option '--dry-run'\n", "stdout":
"<?xml version='1.0'?>\n<stream>\n</stream>\n", "stdout_lines":
["<?xml version='1.0'?>", "<stream>", "</stream>"]}
zypper does not have a --dry-run switch (anymore) apparently.
Johannes
Johannes Kastl [10.01.2017 12:57]:
Hi,
thanks for your answer.
Because some part of your error is in German...
This is just because the error messages are displayed in another
locale, but there are still error messages:
fatal: [XXX]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper",
"--quiet", "--non-interactive", "--xmlout", "refresh", "--dry-run"],
"failed": true, "msg": "Zypper run command failed with return code
2.", "rc": 2, "stderr": "Unknown option '--dry-run'\n", "stdout":
"<?xml version='1.0'?>\n<stream>\n</stream>\n", "stdout_lines":
["<?xml version='1.0'?>", "<stream>", "</stream>"]}
zypper does not have a --dry-run switch (anymore) apparently.
Johannes
Johannes,
I do not think so.
On Leap 42.2, I get
---snip---
# rpm -qa '*zypp*' | sort
PackageKit-backend-zypp-1.1.3-2.3.x86_64
etckeeper-zypp-plugin-1.18.5-11.3.x86_64
libzypp-16.3.2-3.1.x86_64
snapper-zypp-plugin-0.3.3-2.2.noarch
zypp-plugin-python-0.5-5.3.x86_64
zypper-1.13.14-3.1.x86_64
zypper-aptitude-1.13.14-3.1.noarch
zypper-log-1.13.14-3.1.noarch
---pins---
Yes, there was a patch for zypper, I think it came in yesterday. The
command I took as sample ("zypper in --dry-run ossec-hids") finished
without errors.
Maybe it helps to patch zypper via "zypper patch" ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
Regards,
Werner
Hi Werner,
Yes, there was a patch for zypper, I think it came in yesterday. The
command I took as sample ("zypper in --dry-run ossec-hids") finished
without errors.
I did some more testing (which I had no time for yesterday).
The problem is the "update_cache" option to the zypper module. If this
is set to yes, then 'zypper refresh' is called before the actual
installation attempt. And 'zypper refresh --dry-run' does not work and
thus throws the error. IN contrast to the actual installation, which
accepts the --dry-run switch.
So for now I changed my task to not refresh the repositories before
installation and the play works.
Where to report this bug?
Johannes