# ansible yum module can not be used

**URL:** <https://forum.ansible.com/t/ansible-yum-module-can-not-be-used/16350>\
**Category:** Ansible Project\
**Created:** [September 26, 2014, 2:00am UTC](https://forum.ansible.com/t/ansible-yum-module-can-not-be-used/16350 "2014-09-26T02:00:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fe\_Zheng](https://avatars.discourse-cdn.com/v4/letter/f/c77e96/32.png) [@Fe\_Zheng](https://forum.ansible.com/u/Fe_Zheng)\
**Post date:** [September 26, 2014, 2:00am UTC](https://forum.ansible.com/t/ansible-yum-module-can-not-be-used/16350/1 "2014-09-26T02:00:20Z")

</div>

hi  
I faced a problem when use ansible module yum.  
my hosts file /etc/ansible/hosts add  
eg:10.255.22.102 ansible\_python\_interpreter=/usr/local/python2.7/bin/python  
this new interpreter is python2.7  
when i came back to use yum

- name: yum install ntp  
action: yum name=ntp state=present  
sudo: yes  
tags: ntpd  
when: ansible\_distribution != ‘Suse’

problem appear

[![](https://lh3.googleusercontent.com/-bdN_rXY4H1s/VCTImo2AXQI/AAAAAAAAABg/5iMfOjH0tz8/s320/QQ%E5%9B%BE%E7%89%8720140926095926.jpg)](https://lh3.googleusercontent.com/-bdN_rXY4H1s/VCTImo2AXQI/AAAAAAAAABg/5iMfOjH0tz8/s1600/QQ%E5%9B%BE%E7%89%8720140926095926.jpg)

task failed to parsed  
no module named yum

how to solve ,please help

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 26, 2014, 12:01pm UTC](https://forum.ansible.com/t/ansible-yum-module-can-not-be-used/16350/2 "2014-09-26T12:01:31Z")

</div>

Please paste text rather than include screenshots on this mailing list. It’s far easier for everyone reading it.

Thanks!

It sounds like you might have set ansible\_python\_interpreter to point at a non-system python, or perhaps are running locally against a virtualenv, where yum isn’t available. I’d suggest not doing these things, as you need to access the system python installed yum to proceed.
