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

"No module named yum" on fedora23 #855

Closed
chmouel opened this Issue Nov 10, 2015 · 12 comments

Comments

Projects
None yet
5 participants
@chmouel

chmouel commented Nov 10, 2015

On fresh Fedora 23 install I am getting :

TASK: [openshift_facts | Ensure python-netaddr and PyYaml are installed] ******
failed: [master.local.openshift.chmouel.com] => (item=python-netaddr,PyYAML) => {"failed": true, "item": "python-netaddr,PyYAML", "parsed": false}
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1447167427.32-7785535173678/yum", line 27, in 
    import yum
ImportError: No module named yum
OpenSSH_7.1p1, OpenSSL 1.0.2d-fips 9 Jul 2015
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
Shared connection to master.local.openshift.chmouel.com closed.


FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/config.retry

localhost                  : ok=6    changed=0    unreachable=0    failed=0
master.local.openshift.chmouel.com : ok=5    changed=0    unreachable=0    failed=1

root@master:~/openshift-ansible$
@chmouel

This comment has been minimized.

chmouel commented Nov 10, 2015

workaround: dnf install yum would 'fix' it

@chmouel chmouel changed the title from No module named yum to "No module named yum" on fedora23 Nov 10, 2015

@detiber

This comment has been minimized.

Contributor

detiber commented Nov 10, 2015

@chmouel unfortunately, we may just need to add dnf install yum to the prereqs in the README for now unless we can get the community to contribute a proper fix for conditionalizing the package installation steps to use dnf if on fedora and yum on centos7 and rhel7.

@abutcher if you are looking for other tasks, this one may be a candidate.

@chmouel

This comment has been minimized.

chmouel commented Nov 10, 2015

yep i was guessing so :(

There was other things to do as well we need to prereq python-dnf too and that was to install as well on the nodes (not sure if that could be done directly from ansible) after that the install
seemed to install until I hitted bug openshift/origin#5828

@abutcher

This comment has been minimized.

Member

abutcher commented Nov 10, 2015

@detiber with ansible 2.0 we could use the package module https://docs.ansible.com/ansible/package_module.html

@detiber

This comment has been minimized.

Contributor

detiber commented Nov 11, 2015

@abutcher without knowing when 2.0 is going to be released or what issues we'll run into for 2.0 compatibility, I wonder how well the package_module would work using 1.9... we might be able to just ship the package_module in our repo as a workaround until we can fully support 2.0

@detiber

This comment has been minimized.

Contributor

detiber commented Nov 30, 2015

#966 Addresses this

@detiber detiber referenced this issue Nov 30, 2015

Closed

Fedora23 crash #5828

@detiber

This comment has been minimized.

Contributor

detiber commented Dec 4, 2015

@brenton this issue can now be closed

@stevekuznetsov

This comment has been minimized.

Contributor

stevekuznetsov commented Aug 23, 2016

If anyone else is popping into this from Google -- dnf install yum is not always going to fix this issue. If Ansible is using a non-standard Python interpreter like it would in a virtualenv, you need to fiddle with the interpreter, see: http://stackoverflow.com/a/36138921

@detiber

This comment has been minimized.

Contributor

detiber commented Aug 24, 2016

@stevekuznetsov are you actually hitting this? This should be using dnf for Fedora.

@stevekuznetsov

This comment has been minimized.

Contributor

stevekuznetsov commented Aug 24, 2016

@detiber I'm hitting this in my Ansible bits, not in the openshift-ansible code -- but this is among the highest hits on Google if the error message is searched, so I figured it would be helpful to have some better info here.

@detiber

This comment has been minimized.

Contributor

detiber commented Aug 24, 2016

@stevekuznetsov phew.

As an aside, we will be starting to migrate to using the package module instead of the workaround we are currently using to handle yum/dnf now that we have dropped support for Ansible 1.9 in the master branch.

@stevekuznetsov

This comment has been minimized.

Contributor

stevekuznetsov commented Aug 24, 2016

@detiber yeah, that will be nice to get the migration and the benefits from not using command -- until package supports complex use-cases like --{en,dis}ablerepo, though, I think I have to use yum for my work. Hopefully you guys don't have too many bits like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment