ansible failing on Amazon Linux 2015.03

325 views
Skip to first unread message

Eric Stewart

unread,
Mar 25, 2015, 1:17:52 PM3/25/15
to ansible...@googlegroups.com
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 <module>

    import yum

ImportError: No module named yum


Any idea how to get around this problem?

Brian Coca

unread,
Mar 25, 2015, 1:37:39 PM3/25/15
to ansible...@googlegroups.com
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.




--
Brian Coca

Ivan S. Freitas

unread,
Mar 25, 2015, 2:04:36 PM3/25/15
to ansible...@googlegroups.com
On Wed, Mar 25, 2015 at 2:37 PM, Brian Coca <bc...@ansible.com> wrote:

> 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.

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
[2] https://forums.aws.amazon.com/thread.jspa?threadID=174341
[3] https://aws.amazon.com/pt/amazon-linux-ami/2015.03-release-notes/



--
Ivan Sichmann Freitas
GNU/Linux user #509059
SDF MetaArpa Member http://isf.sdf.org/about.html

Brian Coca

unread,
Mar 25, 2015, 2:11:31 PM3/25/15
to ansible...@googlegroups.com
I sit corrected.


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages