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

Error installing packages with yum-module #46301

Closed
RafnexJr opened this issue Sep 29, 2018 · 3 comments
Closed

Error installing packages with yum-module #46301

RafnexJr opened this issue Sep 29, 2018 · 3 comments
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.

Comments

@RafnexJr
Copy link

SUMMARY

If I try to install the Packages yum-utils device-mapper-persistent-data lvm2 with the YUM-Module. I get the Error fatal: [example.example.com]: FAILED! => {"changed": false, "msg": "Failure talking to yum: Invalid version flag from: yum-utils device-mapper-persistent-data lvm2"}. If I run the command local on the machine everything works.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

YUM Module

ANSIBLE VERSION
ansible 2.6.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
CONFIGURATION

Nothing Changed

OS / ENVIRONMENT

Running Ansible from Windows 10 - CentOS Linux release 7.5.1804 (Core) WSL

STEPS TO REPRODUCE

Run on clean CentOS 7 Digital Ocean Droplet. (Only installed the epel package and updated the all packages.)

- name: Install Docker required packages
  yum:
    name: "{{ docker_required_packages }}"
    state: present

Variable File:

---
docker_required_packages: yum-utils device-mapper-persistent-data lvm2
EXPECTED RESULTS

It should install the packages or return that they're already installed.

ACTUAL RESULTS

If I run the Playbook it gives me this error:

TASK [docker-node : Install Docker required packages] ******************************************************************************************************************************************************task path: <censored path> :17
<example.example.com> ESTABLISH SSH CONNECTION FOR USER: None
<example.example.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 example.example.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<example.example.com> (0, '/root\n', '')
<example.example.com> ESTABLISH SSH CONNECTION FOR USER: None
<example.example.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 example.example.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506 `" && echo ansible-tmp-1538226624.0-15049333638506="` echo /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506 `" ) && sleep 0'"'"''
<example.example.com> (0, 'ansible-tmp-1538226624.0-15049333638506=/root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506\n', '')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<example.example.comh> PUT /root/.ansible/tmp/ansible-local-12438_D1mb/tmp5id90u TO /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/yum.py
<example.example.com> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o
PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 '[example.example.com]'
<example.example.com> (0, 'sftp> put /root/.ansible/tmp/ansible-local-12438_D1mb/tmp5id90u /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/yum.py\n', '')
<example.example.com> ESTABLISH SSH CONNECTION FOR USER: None
<example.example.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 example.example.com '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/ /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/yum.py && sleep 0'"'"''
<example.example.com> (0, '', '')
<example.example.com> ESTABLISH SSH CONNECTION FOR USER: None
<example.example.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 -tt example.example.com '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/yum.py && sleep 0'"'"''
<example.example.com> (1, '\r\n{"msg": "Failure talking to yum: Invalid version flag from: yum-utils device-mapper-persistent-data lvm2", "failed": true, "exception": "  File \\"/tmp/ansible_dx_Pw_/ansible_module_yum.py\\", line 565, in what_provides\\n    pkgs = my.returnPackagesByDep(req_spec) + my.returnInstalledPackagesByDep(req_spec)\\n  File \\"/usr/lib/python2.7/site-packages/yum/__init__.py\\", line 4283, in returnPackagesByDep\\n    raise Errors.YumBaseError, _(\'Invalid version flag from: %s\') % str(depstring)\\n", "invocation": {"module_args": {"allow_downgrade": false, "name": ["yum-utils device-mapper-persistent-data lvm2"], "bugfix": false, "list": null, "disable_gpg_check": false, "conf_file": null, "install_repoquery": true, "validate_certs": true, "state": "present", "disablerepo": null, "update_cache": false, "disable_plugin": [], "enablerepo": null, "exclude": null, "security": false, "update_only": false, "enable_plugin": [], "installroot": "/", "skip_broken": false}}}\r\n', 'Shared connection to example.example.com closed.\r\n')
<example.example.com> ESTABLISH SSH CONNECTION FOR USER: None
<example.example.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/293b3e19f9 example.example.com '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tmp-1538226624.0-15049333638506/ > /dev/null 2>&1 && sleep 0'"'"''
<example.example.com> (0, '', '')
The full traceback is:
  File "/tmp/ansible_dx_Pw_/ansible_module_yum.py", line 565, in what_provides
    pkgs = my.returnPackagesByDep(req_spec) + my.returnInstalledPackagesByDep(req_spec)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 4283, in returnPackagesByDep
    raise Errors.YumBaseError, _('Invalid version flag from: %s') % str(depstring)

fatal: [example.example.com]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_downgrade": false,
            "bugfix": false,
            "conf_file": null,
            "disable_gpg_check": false,
            "disable_plugin": [],
            "disablerepo": null,
            "enable_plugin": [],
            "enablerepo": null,
            "exclude": null,
            "install_repoquery": true,
            "installroot": "/",
            "list": null,
            "name": [
                "yum-utils device-mapper-persistent-data lvm2"
            ],
            "security": false,
            "skip_broken": false,
            "state": "present",
            "update_cache": false,
            "update_only": false,
            "validate_certs": true
        }
    },
    "msg": "Failure talking to yum: Invalid version flag from: yum-utils device-mapper-persistent-data lvm2"
}
@RafnexJr RafnexJr changed the title Ansible Yum Package installation Error installing packages with yum-module Sep 29, 2018
@ansibot
Copy link
Contributor

ansibot commented Sep 29, 2018

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

@ansibot
Copy link
Contributor

ansibot commented Sep 29, 2018

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Sep 29, 2018
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Oct 1, 2018
@mkrizek
Copy link
Contributor

mkrizek commented Oct 16, 2018

From yum module documentation (https://docs.ansible.com/ansible/latest/modules/yum_module.html):

To operate on several packages this can accept a comma separated list of packages or (as of 2.0) a list of packages.

So, your variable needs to look like this:

docker_required_packages: yum-utils, device-mapper-persistent-data, lvm2

or (for instance) this:

docker_required_packages:
  - yum-utils
  - device-mapper-persistent-data
  - lvm2

@mkrizek mkrizek closed this as completed Oct 16, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

4 participants