These days I wanted to give Ansible a try. And the first barrier has been its installation. Ansible relies on Python 2.6My sandbox is a CentOs 5 one and the standard version of Python is 2.4.
So first has mentioned in the documentation, I have enabled the EPEL repositories and installed the required dependencies.
And that's where the problems started
Indeed on CentOs 5, YUM requires Python is 2.4. So you want just update you're version of Python updating the symnlink.
So the issue is how to use Python 2.6 (for Ansible ) and Python 2.4 at the same time?
Well, the answer is more a trick than a tip. You have to put BOTH versions into you path, and both must propose the python executable. BUT Python 2.6 must be ahead in the path.
For instance in my config I have
$ echo $PATH
$ which python
So the trick is
$ ln -sf /usr/bin/python26 /usr/local/bin/python
- python 2.6 is in
/usr/local/bin *which is before
/usr/bin in the
- python 2.4 is in
- And both are in the
With such workaround I'm able to properly use Ansible and still have YUM working.