# ansible failing on Amazon Linux 2015.03

**URL:** <https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838>\
**Category:** Ansible Project\
**Created:** [March 25, 2015, 4:38pm UTC](https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838 "2015-03-25T16:38:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Stewart](https://avatars.discourse-cdn.com/v4/letter/e/e9bcb4/32.png) [@Eric\_Stewart](https://forum.ansible.com/u/Eric_Stewart)\
**Post date:** [March 25, 2015, 4:38pm UTC](https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838/1 "2015-03-25T16:38:26Z")

</div>

Amazon released Amazon Linux 2015.03 today and as result they moved the core version of Python from 2.6 to 2.7. I now get the following error when attempting to run unusable playbook on this new release.

failed: [xxx.xxx.xxx.xxx] =\> (item=htop,git,mysql) =\> {“failed”: true, “item”: “htop,git,mysql”, “parsed”: false}

SUDO-SUCCESS-oryamgsbitlsxgamrewinmkijqtgpnys

Traceback (most recent call last):

File “/home/ec2-user/.ansible/tmp/ansible-tmp-1427300667.75-234664212906684/yum”, line 27, in

import yum

ImportError: No module named yum

Any idea how to get around this problem?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 25, 2015, 5:37pm UTC](https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838/2 "2015-03-25T17:37:32Z")

</div>

so the yum module uses the python yum library which is normally  
installed on systems that use yum by default.

In the latest amazon linux it seems they did add the module for  
python2.6 but not to python2.7, you will need to either install this  
python library before being able to use the yum module with python2.7  
or just set ansible\_python\_interpreter to point at the 2.6 one.

---

<div class="post-metadata">

**Author:** ![Ivan\_S\_Freitas](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ivan\_S\_Freitas](https://forum.ansible.com/u/Ivan_S_Freitas)\
**Post date:** [March 25, 2015, 6:04pm UTC](https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838/3 "2015-03-25T18:04:26Z")

</div>

It's the other way around, python2.6 isn't shipped with the yum  
module. Some people already reported this in the aws forums [1] [2],  
and it can be corrected in already running instances by setting the  
correct python version using the 'alternatives' command, shown in both  
posts and in the release notes [3].

Also, they already fixed that in the repository, so newly launched  
instances get this fixed during the automatic upgrade of a first  
booted instance using Amazon Linux.

[1] [https://forums.aws.amazon.com/thread.jspa?threadID=174345](https://forums.aws.amazon.com/thread.jspa?threadID=174345)  
[2] [https://forums.aws.amazon.com/thread.jspa?threadID=174341](https://forums.aws.amazon.com/thread.jspa?threadID=174341)  
[3] [https://aws.amazon.com/pt/amazon-linux-ami/2015.03-release-notes/](https://aws.amazon.com/pt/amazon-linux-ami/2015.03-release-notes/)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 25, 2015, 6:11pm UTC](https://forum.ansible.com/t/ansible-failing-on-amazon-linux-2015-03/17838/4 "2015-03-25T18:11:26Z")

</div>

I sit corrected.
