Accelerated Mode, Python 2.6, and CentOS 5

This may be a stupid question, but I want to be sure I’m not missing something…

Accelerated mode seems to require some Python 2.5+ syntax, and per commit a66cfed on the devel branch, the docs have been updated to state that it requires 2.5+ and python-keyczar. So on CentOS 5, which of course comes with Python 2.4 in /usr/bin/python, I wrote a bootstrap playbook that would run using /usr/bin/python, install python 2.6 via yum (as /usr/bin/python2.6), install a custom-compiled libgmp (since the one that comes with CentOS 5 is too old for keyczar), and then install keyczar. That part all works great for me.

My plan was then to set ansible_python_interpreter to /usr/bin/python2.6 on the CentOS 5 hosts, so they could use my custom setup for Accelerated mode. However, that fails because /usr/bin/python2.6 doesn’t have the “yum” module - and probably is missing other things - which don’t seem to be installable in any method I could figure out. And I stumbled across this old thread where Michael said using a python other than the OS’s default is not a good idea.

So my question is simple: if I want to use Accelerated Mode on a client that only has Python 2.4 as it’s default, like CentOS 5, am I just out of luck?

A follow-up question: If the answer to the above is “yes, you can’t use accel mode on CentOS 5”, then is it possible to turn on accelerated mode for specific hosts/host groups via the “host_vars” and “group_vars” variable files, or can it only be done in the play definition? I’d love to be able to enable it for newer systems while leaving it disabled for the older ones, without needing to muck around with my existing host groups…

Thanks!
Kevin

I got exactly the same use case. If there’s a smart solution I’m interested, otherwise using a “redhat5” group_vars with var accelerate: false allowed me to make an exception over old OSs.