Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zypper model lacking ability to send extra options only valid for install/upgrade operations #381

Closed
marbud0 opened this issue May 20, 2020 · 5 comments
Labels
bug This issue/PR relates to a bug has_pr module module

Comments

@marbud0
Copy link
Contributor

marbud0 commented May 20, 2020

SUMMARY

Zypper module fails if you give arguments only valid for install/upgrade operation via the extra_args

ISSUE TYPE
  • Bug Report
COMPONENT NAME

zypper

ANSIBLE VERSION
ansible 2.8.8
  config file = /home/mbudsjo/src/CAE/server/ansible.cfg
  configured module search path = ['/home/mbudsjo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mbudsjo/Envs/emacs-py3/lib/python3.8/site-packages/ansible
  executable location = /home/mbudsjo/Envs/emacs-py3/bin/ansible
  python version = 3.8.2 (default, Apr 27 2020, 15:53:34) [GCC 9.3.0]

CONFIGURATION
ANSIBLE_PIPELINING(/home/mbudsjo/src/CAE/server/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/mbudsjo/src/CAE/server/ansible.cfg) = -C -o ControlMaster=auto -o ControlPersist=>
ANSIBLE_SSH_CONTROL_PATH(/home/mbudsjo/src/CAE/server/ansible.cfg) = %(directory)s/ansible-ssh-%%h-%%p-%>
DEFAULT_FORKS(/home/mbudsjo/src/CAE/server/ansible.cfg) = 40
DEFAULT_GATHERING(/home/mbudsjo/src/CAE/server/ansible.cfg) = smart
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/mbudsjo/src/CAE/server/ansible.cfg) = True
DEFAULT_MANAGED_STR(/home/mbudsjo/src/CAE/server/ansible.cfg) = This file is managed by Ansible. Local c>
DEFAULT_POLL_INTERVAL(/home/mbudsjo/src/CAE/server/ansible.cfg) = 15
DEFAULT_ROLES_PATH(/home/mbudsjo/src/CAE/server/ansible.cfg) = ['/home/mbudsjo/src/CAE/server/roles', '/>
DEFAULT_VAULT_PASSWORD_FILE(/home/mbudsjo/src/CAE/server/ansible.cfg) = /home/mbudsjo/src/CAE/server/bin>
INTERPRETER_PYTHON(/home/mbudsjo/src/CAE/server/ansible.cfg) = /usr/bin/python
INVENTORY_IGNORE_EXTS(/home/mbudsjo/src/CAE/server/ansible.cfg) = ['.pyc', '.pyo', '.swp', '.bak', '.rpm>
RETRY_FILES_ENABLED(/home/mbudsjo/src/CAE/server/ansible.cfg) = True

OS / ENVIRONMENT

SUSE 11 and 12.

STEPS TO REPRODUCE

Send one of

  • --allow-vendor-change
  • --replacefiles
  • --force-resolution

as extra_args and the zypper call will fail.

EXPECTED RESULTS
ACTUAL RESULTS

Extra_args is feed to all calls to zypper and the module seems to lookup the packages before it does the actual installation. And zypper don't allow for installation specific options when not running in install mode.

mbudsjo@hp-1337-3 $ ansible -i inventories/production/ -m zypper -a'package=bash extra_args=--force-resolution' cs2-0002
cs2-0002 | FAILED! => {
    "changed": false,
    "cmd": [
        "/usr/bin/zypper",
        "--quiet",
        "--non-interactive",
        "--xmlout",
        "--disable-repositories",
        "search",
        "--type",
        "package",
        "--force-resolution",
        "--match-exact",
        "--details",
        "--installed-only",
        "bash"
    ],
    "msg": "Zypper run command failed with return code 2.",
    "rc": 2,
    "stderr": "Unknown option '--force-resolution'\n",
    "stderr_lines": [
        "Unknown option '--force-resolution'"
    ],
    "stdout": "<?xml version='1.0'?>\n<stream>\n</stream>\n",
    "stdout_lines": [
        "<?xml version='1.0'?>",
        "<stream>",
        "</stream>"
    ]
}

@ansibullbot
Copy link
Collaborator

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

@marbud0
Copy link
Contributor Author

marbud0 commented May 20, 2020

Added PR #382 with suggested fix.

@marbud0
Copy link
Contributor Author

marbud0 commented Jun 5, 2020

#382 is merged, thus closing this issue.

@marbud0 marbud0 closed this as completed Jun 5, 2020
@evrardjp
Copy link

evrardjp commented Jun 5, 2020

Thanks @marbud0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module
Projects
None yet
Development

No branches or pull requests

3 participants