# Install requirements

**URL:** <https://forum.ansible.com/t/install-requirements/11715>\
**Category:** Ansible Project\
**Created:** [July 24, 2012, 1:09pm UTC](https://forum.ansible.com/t/install-requirements/11715 "2012-07-24T13:09:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 24, 2012, 1:09pm UTC](https://forum.ansible.com/t/install-requirements/11715/1 "2012-07-24T13:09:13Z")

</div>

Hi  
I am having some issues in getting ansible working…

I am trying to install it on a Oracle Linux 5.8 box ( please don’t increase my pain by asking why )

Requirements installed:  
Setting up Install Process  
Package python26-2.6.8-1.el5.x86\_64 already installed and latest version  
Package python26-PyYAML-3.08-4.el5.x86\_64 already installed and latest version  
Package python26-paramiko-1.7.7.1-1.el5.noarch already installed and latest version  
Package python26-jinja2-2.5.5-4.el5.noarch already installed and latest version

yet…

rpm -ivh ansible-0.6-1.noarch.rpm  
error: Failed dependencies:  
PyYAML is needed by ansible-0.6-1.noarch  
python-jinja2 is needed by ansible-0.6-1.noarch  
python-paramiko is needed by ansible-0.6-1.noarch

The rpm was downloaded from git following the web page instructions and build as my own user.

Any suggestions?

Regards

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 24, 2012, 1:18pm UTC](https://forum.ansible.com/t/install-requirements/11715/2 "2012-07-24T13:18:46Z")

</div>

Fixed it by changing the spec file required section. I would suggest an if based requirements section if possible based on destination OS.

Regards

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 24, 2012, 1:42pm UTC](https://forum.ansible.com/t/install-requirements/11715/3 "2012-07-24T13:42:28Z")

</div>

Still broken, after getting it to install… the next issue is:

Traceback (most recent call last):  
File “/usr/bin/ansible”, line 25, in ?  
from ansible.runner import Runner  
File “/usr/lib/python2.4/site-packages/ansible/runner/ **init**.py”, line 673  
with open(in\_path) as f:  
^  
SyntaxError: invalid syntax

then optimistically I change the top of the script to point to python26 but that gave me the following error:  
Traceback (most recent call last):  
File “/usr/bin/ansible”, line 25, in   
from ansible.runner import Runner  
ImportError: No module named ansible.runner

Regards

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 24, 2012, 1:44pm UTC](https://forum.ansible.com/t/install-requirements/11715/4 "2012-07-24T13:44:53Z")

</div>

Looks like you are not using python 2.6

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 24, 2012, 2:26pm UTC](https://forum.ansible.com/t/install-requirements/11715/5 "2012-07-24T14:26:32Z")

</div>

Hi  
Fair enough but how do I get my system or ansible to use python26. I have followed the installation instructions to the letter. alternatives did not list python as something I could change.

I also tested on CentOS 5.8 and getting the same errors so I can’t blame Oracle Linux.

Regards

---

<div class="post-metadata">

**Author:** ![jpmens1](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jpmens1](https://forum.ansible.com/u/jpmens1)\
**Post date:** [July 24, 2012, 4:00pm UTC](https://forum.ansible.com/t/install-requirements/11715/6 "2012-07-24T16:00:13Z")

</div>

Gerhardus,

> Fair enough but how do I get my system or ansible to use python26.

My personal suggestion is to run Ansible directly out of the download  
from Github. In other words, I'd try the following:

1. Get a recent version of Python installed, no matter in which  
&nbsp;&nbsp;&nbsp;directory; call it $PYTH  
2. Set your PATH variable to contain $PYTH/bin as first slot  
3. Download Ansible and extract into some directory, e.g. ~/ansible  
4. $ cd ~/ansible  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$ source .hacking/env-setup

You should then find that `ansible' and `ansible-playbook' are in your  
path, and you should be able to execute them.

You'll have to set $ANSIBLE\_HOSTS=/etc/ansible/hosts (or any other file)  
and you can continue from there.

Hope that helps,

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-JP

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 24, 2012, 5:14pm UTC](https://forum.ansible.com/t/install-requirements/11715/7 "2012-07-24T17:14:05Z")

</div>

We execute python via /usr/bin/env so all you need is for the newer python to be ahead in your path.

Step 1+2

(others optional)

–Michael

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 24, 2012, 5:46pm UTC](https://forum.ansible.com/t/install-requirements/11715/8 "2012-07-24T17:46:27Z")

</div>

Excellent, thank you gents. I will give that a go tomorrow morning.

Regards

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 25, 2012, 11:07am UTC](https://forum.ansible.com/t/install-requirements/11715/9 "2012-07-25T11:07:52Z")

</div>

Hi  
I have given up on getting ansible working on Red Hat/CentOS 5.x.  
I am most likely being thick but I wanted a quick solution and having to fix rpm spec files or setting enviroment variables etc is painful. Puppet suddenly seems an equivalent goal.

whereis python  
python: /usr/bin/python2.6 /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.6 /usr/lib/python2.4 /usr/include/python2.6 /usr/share/man/man1/python.1.gz

echo $PATH  
/usr/local/bin:/bin:/usr/bin:/home/geldenhuisg/bin

I did install the latest available python26 as per the instructions on the webpage for ansible.

When that failed I tried Ubuntu, slightly easier… but I still have to use it as a developer.

This is the requirements for an Ubunutu box, would be nice if this could be added to the getting started page:  
sudo apt-get install python-jinja2  
sudo apt-get install python-paramiko  
sudo apt-get install python-yaml

make deb fails, as in does not create a deb file. The documentation is incomplete with regards to the pre-requisites for building a deb file unless you are not expected to be able to do that on a Ubuntu box.

ANSIBLE\_SSH\_ARGS is not documented. Is these arguments for the daemon, arguments for the ssh command or can I point it to my .ssh/config file? Again a link to some documentation when talking about this parameter would be usefull.

From the web page:  
ANSIBLE\_SSH\_ARGS are not set, ansible will try to use some sensible ControlMaster options by default. You are free to override this environment variable, but should still pass ControlMaster options to ensure performance of this transport. With ControlMaster in use, both transports are roughly the same speed. Without CM, the binary ssh transport is significantly slower.

That’s a bit up in the air… what is sensible ControlMaster options? A link to what the values are would be usefull. I have ControlMaster values set and I would like the existing ones to be respected and my specified directory being used rather than an undocumented default value.

Apologies if the preceeding email is a bit of a rant. I really like the concept of ansible the ability to just get stuff done without massive install and configure requirements. Unfortunately this has not been the case for me, it certainly does not work out of the box easily nor is the documentation complete enough. Blame me for being stupid/lazy/thick but I am likely representative of other stupid/lazy/thick sysadmins who just want to get stuff done. I would like to make this work because it will save me time and am happy to keep on trying stuff and making suggestion for documentation improvements and pointing out holes in the docs.

Regards

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 25, 2012, 11:50am UTC](https://forum.ansible.com/t/install-requirements/11715/10 "2012-07-25T11:50:29Z")

</div>

A new Python on CentOS 5.8 strikes me as a simple problem, and I've only heard the one question from you on the subject, which we helped out last night, you should definitely stop by IRC before you "give up". You might also find it easier to just use a newer box for your control machine.

I do not understand why you gave up on that and just switched to Ubuntu, though there is nothing wrong with Ubuntu, it strikes me as super easy to solve for RHEL 5.X with python 2.6, though I'd be infinitely more apt to just install a CentOS box and be done with it.  
&nbsp;&nbsp;

> This is the requirements for an Ubunutu box, would be nice if this could be added to the getting started page:  
> sudo apt-get install python-jinja2  
> sudo apt-get install python-paramiko  
> sudo apt-get install python-yaml

I'm a CentOS user, but I'll speak to this, as there are a lot of Debian/Ubuntu users here too. We support both, as well as other distributions.

We had some initial work to make the Debian package stuff, and people are using it.

I welcome patches and improvements, and have received a few from time to time. Without your sharing how it "failed" for you, we have no idea how to fix it. Just saying it "failed" is unfortunately not going to help us fix whatever problem building it you observed, or give you any instructions to help you along.

Ansible also runs pretty well straight out of source, which is what it seems 70+% of people here do.

I am also very interested in proper inclusion in Debian and Ubuntu, and was approached by a Canonical employee offering to do this, though they seem terrible about contributing and communicating with upstream, as I have seen in the past when running the Cobbler project. So, if we want this to get better, this is a OSS project, so … anyone is welcome to peruse that.

> That's a bit up in the air... what is sensible ControlMaster options? A link to what the values are would be usefull. I have ControlMaster values set and I would like the existing ones to be respected and my specified directory being used rather than an undocumented default value.

[https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py)

The options are:

ControlMaster=auto ControlPersist=60s ControlPath=/tmp/ansible-ssh-%h-%p-%r

Seems super easy to add to the docs.

> Apologies if the preceeding email is a bit of a rant. I really like the concept of ansible the ability to just get stuff done without massive install and configure requirements. Unfortunately this has not been the case for me, it certainly does not work out of the box easily nor is the documentation complete enough.

the documentation is an open project, and any thing that is missing can easily be rectified. github.com/ansible/ansible.github.com.

Contributions are welcome. Just edit the "rst/" directory and send a pull request.

---

<div class="post-metadata">

**Author:** ![John\_Kleint](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@John\_Kleint](https://forum.ansible.com/u/John_Kleint)\
**Post date:** [July 25, 2012, 12:42pm UTC](https://forum.ansible.com/t/install-requirements/11715/11 "2012-07-25T12:42:58Z")

</div>

I’ve run into the same problem with other software that wants a recent Python on Red Hat 5; the fix needs one extra step. Apologies if you’ve already tried this, but I figured I’d share for others who come across it.

First, you have to install Python 2.6:

$ sudo yum install python26

This doesn’t change the default when you run ‘python’: it’s still 2.4. So make a symlink to 2.6 named python (I keep mine in ~/bin but you can put it where you like):

$ cd ~/bin ; ln -s /usr/bin/python2.6 python

Then make sure ~/bin (or wherever you put it) goes first in your PATH:

$ export PATH=~/bin:$PATH

And of course if you want the PATH change to stick you should put that line in your .bashrc or what have you.

You can test this by running:

$ env python -V  
Python 2.6.8

which is how the ansible scripts run it, so you should be good to go.

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [July 25, 2012, 12:50pm UTC](https://forum.ansible.com/t/install-requirements/11715/12 "2012-07-25T12:50:23Z")

</div>

Hi

> A new Python on CentOS 5.8 strikes me as a simple problem, and I’ve only heard the one question from you on the subject, which we helped out last night, you should definitely stop by IRC before you “give up”. You might also find it easier to just use a newer box for your control machine.

I struck me as a simple problem as well but I could not make it work in the time I spent on it. There is nothing I would love to do more than use a newer box. I am foreced to use 5.8 and not just an old version it is Oracle Linux which means even though it is suppose to be the same, there is some subtle differences that breaks things.

> I do not understand why you gave up on that and just switched to Ubuntu, though there is nothing wrong with Ubuntu, it strikes me as super easy to solve for RHEL 5.X with python 2.6, though I’d be infinitely more apt to just install a CentOS box and be done with it.

I am happy to give it another go RHEL 5.x would be preferred.

> > This is the requirements for an Ubunutu box, would be nice if this could be added to the getting started page:  
> > sudo apt-get install python-jinja2  
> > sudo apt-get install python-paramiko  
> > sudo apt-get install python-yaml
> 
> I’m a CentOS user, but I’ll speak to this, as there are a lot of Debian/Ubuntu users here too. We support both, as well as other distributions.
> 
> We had some initial work to make the Debian package stuff, and people are using it.
> 
> I welcome patches and improvements, and have received a few from time to time. Without your sharing how it “failed” for you, we have no idea how to fix it. Just saying it “failed” is unfortunately not going to help us fix whatever problem building it you observed, or give you any instructions to help you along.

Apologies for the user style of reporting errors. I will submit a detailed listing and description of my failure.

> Ansible also runs pretty well straight out of source, which is what it seems 70+% of people here do.
> 
> I am also very interested in proper inclusion in Debian and Ubuntu, and was approached by a Canonical employee offering to do this, though they seem terrible about contributing and communicating with upstream, as I have seen in the past when running the Cobbler project. So, if we want this to get better, this is a OSS project, so … anyone is welcome to peruse that.
> 
> > That’s a bit up in the air… what is sensible ControlMaster options? A link to what the values are would be usefull. I have ControlMaster values set and I would like the existing ones to be respected and my specified directory being used rather than an undocumented default value.
> 
> [https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py)
> 
> The options are:
> 
> ControlMaster=auto ControlPersist=60s ControlPath=/tmp/ansible-ssh-%h-%p-%r
> 
> Seems super easy to add to the docs.

Fair enough I will send a pull request with some updates. Can you clarify if the ssh options that is specified are passed as “normal” parameters to the ssh command?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 25, 2012, 12:57pm UTC](https://forum.ansible.com/t/install-requirements/11715/13 "2012-07-25T12:57:48Z")

</div>

> I struck me as a simple problem as well but I could not make it work in the time I spent on it. There is nothing I would love to do more than use a newer box. I am foreced to use 5.8 and not just an old version it is Oracle Linux which means even though it is suppose to be the same, there is some subtle differences that breaks things.

I'd expect the EPEL 2.6 packages to still work with OEL.  
&nbsp;&nbsp;  
Yeah, post any output you have, so we can look. Don't know what "break things" looks like.

> \>  
> \> Ansible also runs pretty well straight out of source, which is what it seems 70+% of people here do.  
> \>  
> \> I am also very interested in proper inclusion in Debian and Ubuntu, and was approached by a Canonical employee offering to do this, though they seem terrible about contributing and communicating with upstream, as I have seen in the past when running the Cobbler project. So, if we want this to get better, this is a OSS project, so … anyone is welcome to peruse that.  
> \>  
> \> \> That's a bit up in the air... what is sensible ControlMaster options? A link to what the values are would be usefull. I have ControlMaster values set and I would like the existing ones to be respected and my specified directory being used rather than an undocumented default value.  
> \>  
> \>  
> \> [https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/connection/ssh.py)  
> \>  
> \> The options are:  
> \>  
> \> ControlMaster=auto ControlPersist=60s ControlPath=/tmp/ansible-ssh-%h-%p-%r  
> \>  
> \> Seems super easy to add to the docs.
> 
> Fair enough I will send a pull request with some updates. Can you clarify if the ssh options that is specified are passed as "normal" parameters to the ssh command?

Yes, the options in ANSIBLE\_SSH\_ARGS are taken as a string.

Ansible will also add -o Port, -o User and -o IdentityFile to the end, depending on options used in playbooks or /usr/bin/ansible

As mentioned in the docs, not using ControlMaster will be near-fatal on performance, which is why we supply it by default. We simply cannot bear people saying "OMG, this is slow, don't use that Ansible thingy" so we make it fast by default and let people change the options if they need to.

(There is also nothing wrong with the original paramiko connection type if you don't need more advanced tricks like Kerberos  
or jump hosts, and then you don't have to think about ANSIBLE\_SSH\_ARGS at all)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 25, 2012, 12:21pm UTC](https://forum.ansible.com/t/install-requirements/11715/14 "2012-09-25T12:21:31Z")

</div>

This is because the Makefile just says "python" and picks whatever is  
first in your path.

You could modify your PATH or use virtualenv.

---

<div class="post-metadata">

**Author:** ![Rawiri\_Blundell](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Rawiri\_Blundell](https://forum.ansible.com/u/Rawiri_Blundell)\
**Post date:** [September 26, 2012, 12:23am UTC](https://forum.ansible.com/t/install-requirements/11715/15 "2012-09-26T00:23:03Z")

</div>

> > Apologies for the thread bump, but I’m experiencing the same issue.  
> > Building on CentOS 5.x (another “don’t ask” situation). I’ve setup Python  
> > 2.6 as detailed by the documentation and John Kleint’s post. I’ve git  
> > cloned to /opt/ansible and I’m running make rpm in there as root.
> 
> This is because the Makefile just says “python” and picks whatever is  
> first in your path.
> 
> You could modify your PATH or use virtualenv.

Hi Michael,thanks for getting back to me. Yep - PATH is modified hence:

“and John Kleint’s post” (i.e. the environment is setup as per John’s post)

and

“[root@linuxd2 ansible]# python -V  
Python 2.6.8”

(i.e. indicating that the PATH is right and calling “python” is invoking 2.6)

It appears that make rpm starts the build correctly on 2.6 but then switches to 2.4. All the interesting output was copied and pasted to my previous post.

It looks like the variable ${\_\_python} in packaging/rpm/ansible.spec is where the build dutifully switches back to 2.4 (showing + **/usr/bin/python** setup.py build in the output rather than python setup.py build or /usr/bin/env python setup.py build). Swapping that variable for python results in a healthier looking but failed build, showing the following output:

**_snip_**

/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: ‘install\_requires’  
warnings.warn(msg)  
running sdist  
warning: sdist: standard file not found: should have one of README, README.txt  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
reading manifest template ‘MANIFEST.in’  
warning: no files found matching ‘packaging/distutils/setup.py’

**_snip_**

RPM build errors:  
File not found by glob: /var/tmp/ansible-0.8-0.git201209240523.el5-buildroot/usr/lib/python2.4/site-packages/ansible\*  
Installed (but unpackaged) file(s) found:  
/usr/lib/python2.6/site-packages/ansible-0.8-py2.6.egg-info  
/usr/lib/python2.6/site-packages/ansible/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/noop.py  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/noop.pyc  
/usr/lib/python2.6/site-packages/ansible/callback\_plugins/noop.pyo  
/usr/lib/python2.6/site-packages/ansible/callbacks.py  
/usr/lib/python2.6/site-packages/ansible/callbacks.pyc  
/usr/lib/python2.6/site-packages/ansible/callbacks.pyo  
/usr/lib/python2.6/site-packages/ansible/color.py  
/usr/lib/python2.6/site-packages/ansible/color.pyc  
/usr/lib/python2.6/site-packages/ansible/color.pyo  
/usr/lib/python2.6/site-packages/ansible/constants.py  
/usr/lib/python2.6/site-packages/ansible/constants.pyc  
/usr/lib/python2.6/site-packages/ansible/constants.pyo  
/usr/lib/python2.6/site-packages/ansible/errors.py  
/usr/lib/python2.6/site-packages/ansible/errors.pyc  
/usr/lib/python2.6/site-packages/ansible/errors.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/inventory/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/expand\_hosts.py  
/usr/lib/python2.6/site-packages/ansible/inventory/expand\_hosts.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/expand\_hosts.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/group.py  
/usr/lib/python2.6/site-packages/ansible/inventory/group.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/group.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/host.py  
/usr/lib/python2.6/site-packages/ansible/inventory/host.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/host.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/ini.py  
/usr/lib/python2.6/site-packages/ansible/inventory/ini.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/ini.pyo  
/usr/lib/python2.6/site-packages/ansible/inventory/script.py  
/usr/lib/python2.6/site-packages/ansible/inventory/script.pyc  
/usr/lib/python2.6/site-packages/ansible/inventory/script.pyo  
/usr/lib/python2.6/site-packages/ansible/module\_common.py  
/usr/lib/python2.6/site-packages/ansible/module\_common.pyc  
/usr/lib/python2.6/site-packages/ansible/module\_common.pyo  
/usr/lib/python2.6/site-packages/ansible/playbook/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/playbook/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/playbook/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/playbook/play.py  
/usr/lib/python2.6/site-packages/ansible/playbook/play.pyc  
/usr/lib/python2.6/site-packages/ansible/playbook/play.pyo  
/usr/lib/python2.6/site-packages/ansible/playbook/task.py  
/usr/lib/python2.6/site-packages/ansible/playbook/task.pyc  
/usr/lib/python2.6/site-packages/ansible/playbook/task.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/runner/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/assemble.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/assemble.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/assemble.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/async.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/async.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/async.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/copy.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/copy.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/copy.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/fetch.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/fetch.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/fetch.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/normal.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/normal.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/normal.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/raw.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/raw.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/raw.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/template.py  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/template.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/action\_plugins/template.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/connection.py  
/usr/lib/python2.6/site-packages/ansible/runner/connection.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/connection.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ **init**.py  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ **init**.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ **init**.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/local.py  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/local.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/local.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/paramiko\_ssh.py  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/paramiko\_ssh.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/paramiko\_ssh.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ssh.py  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ssh.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/ssh.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/poller.py  
/usr/lib/python2.6/site-packages/ansible/runner/poller.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/poller.pyo  
/usr/lib/python2.6/site-packages/ansible/runner/return\_data.py  
/usr/lib/python2.6/site-packages/ansible/runner/return\_data.pyc  
/usr/lib/python2.6/site-packages/ansible/runner/return\_data.pyo  
/usr/lib/python2.6/site-packages/ansible/utils.py  
/usr/lib/python2.6/site-packages/ansible/utils.pyc  
/usr/lib/python2.6/site-packages/ansible/utils.pyo  
make: \*\*\* [rpm] Error 1

I hope that helps you to understand the issue a bit better. Please let me know if I can try anything else.

-Rawiri

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 26, 2012, 1:04am UTC](https://forum.ansible.com/t/install-requirements/11715/16 "2012-09-26T01:04:28Z")

</div>

\_\_python being a Fedora/EPEL packaging guideline thing I don't think  
we want to change it.

I'm not sure what the EPEL build system does for this.

Tim, any thoughts?

--Michael

---

<div class="post-metadata">

**Author:** ![Rawiri\_Blundell](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Rawiri\_Blundell](https://forum.ansible.com/u/Rawiri_Blundell)\
**Post date:** [September 26, 2012, 1:39am UTC](https://forum.ansible.com/t/install-requirements/11715/17 "2012-09-26T01:39:33Z")

</div>

I’ve managed to get it to build an rpm now. There was one more instance of %{\_\_python} tucked away in packaging/rpm/ansible.spec which causes the build to reference /usr/lib/python2.4/site-packages rather than /usr/lib/python2.6/site-packages

It’s this line:

%{!?python\_sitelib: %global python\_sitelib %(%{\_\_python} -c “from distutils.sysconfig import get\_python\_lib; print(get\_python\_lib())”)}

Updating it to read:

%{!?python\_sitelib: %global python\_sitelib %(python -c “from distutils.sysconfig import get\_python\_lib; print(get\_python\_lib())”)}

Sorts that problem out. Obviously it’s not a permanent fix.

Now the interesting bits of the build output are:

**_snip_**

/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: ‘install\_requires’  
warnings.warn(msg)  
running sdist  
warning: sdist: standard file not found: should have one of README, README.txt  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
reading manifest template ‘MANIFEST.in’  
warning: no files found matching ‘packaging/distutils/setup.py’

**_snip_**

running build\_py  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)  
package init file ‘lib/ansible/runner/action\_plugins/ **init**.py’ not found (or not a regular file)

**_snip_**

Requires: /root/bin/python /usr/bin/env PyYAML config(ansible) = 0.8-0.git201209240523.el5 python(abi) = 2.6 python-jinja2 python-paramiko

_snip_

And installing the rpm still fails:

[root@linuxd2 rpm-build]# rpm -Uvh ansible-0.8-0.git201209240523.el5.noarch.rpm  
error: Failed dependencies:  
/root/bin/python is needed by ansible-0.8-0.git201209240523.el5.noarch  
python-jinja2 is needed by ansible-0.8-0.git201209240523.el5.noarch  
python-paramiko is needed by ansible-0.8-0.git201209240523.el5.noarch

-Rawiri

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 26, 2012, 2:02am UTC](https://forum.ansible.com/t/install-requirements/11715/18 "2012-09-26T02:02:18Z")

</div>

> And installing the rpm still fails:
> 
> [root@linuxd2 rpm-build]# rpm -Uvh  
> ansible-0.8-0.git201209240523.el5.noarch.rpm  
> error: Failed dependencies:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/root/bin/python is needed by  
> ansible-0.8-0.git201209240523.el5.noarch  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;python-jinja2 is needed by ansible-0.8-0.git201209240523.el5.noarch  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;python-paramiko is needed by  
> ansible-0.8-0.git201209240523.el5.noarch

Naturally RPM is not going to install dependencies for you. That's  
what yum is for.

I'd recommend you just get Ansible 0.7 out of EPEL \*OR\* use "make  
install" for now if you want to track 0.8.

---

<div class="post-metadata">

**Author:** ![Rawiri\_Blundell](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@Rawiri\_Blundell](https://forum.ansible.com/u/Rawiri_Blundell)\
**Post date:** [September 26, 2012, 3:08am UTC](https://forum.ansible.com/t/install-requirements/11715/19 "2012-09-26T03:08:56Z")

</div>

Yeah, the problem with 0.7 from EPEL is that it’s el6 on el5, and it’s still confused over Python versions:

[root@linuxd2 ansible]# rpm -Uvh ansible-0.7-0.git201209061851.el6.noarch.rpm  
warning: ansible-0.7-0.git201209061851.el6.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 0608b895  
error: Failed dependencies:  
python-jinja2 is needed by ansible-0.7-0.git201209061851.el6.noarch  
python-paramiko is needed by ansible-0.7-0.git201209061851.el6.noarch  
rpmlib(FileDigests) \<= 4.6.0-1 is needed by ansible-0.7-0.git201209061851.el6.noarch  
rpmlib(PayloadIsXz) \<= 5.2-1 is needed by ansible-0.7-0.git201209061851.el6.noarch

In other words: when it says, for example, python-jinja2, on RH/Cent-5 that points to the 2.4 version, and it should really mean python26-jinja2, which is already installed as per [http://ansible.cc/docs/gettingstarted.html](http://ansible.cc/docs/gettingstarted.html)

I’ve soldiered on though. To get rid of the /root/bin/python requirement, I’ve changed every manual instance for python or /usr/bin/env python to point to python26. So now PATH is not an issue, doesn’t need to be modified etc. The list of entries are as follows:

[root@linuxd2 ansible]# grep -ri python26 \* | grep -v rpm-build  
Binary file ansible-0.8-0.git201209240523.el5.noarch.rpm matches  
Makefile:SITELIB = $(shell python26 -c “from distutils.sysconfig import get\_python\_lib; print get\_python\_lib()”)  
Makefile:all: clean python26  
Makefile: python26 setup.py build  
Makefile: python26 setup.py install  
Makefile: python26 setup.py sdist -t MANIFEST.in  
packaging/rpm/ansible.spec:%{!?python\_sitelib: %global python\_sitelib %(python26 -c “from distutils.sysconfig import get\_python\_lib; print(get\_python\_lib())”)}  
packaging/rpm/ansible.spec:Requires: python26-paramiko  
packaging/rpm/ansible.spec:Requires: python26-jinja2  
packaging/rpm/ansible.spec:python26 setup.py build  
packaging/rpm/ansible.spec:python26 setup.py install -O1 --root=$RPM\_BUILD\_ROOT  
setup.py:#!/usr/bin/env python26

Now it builds happily, with the following requirements:

Requires: /usr/bin/env /usr/bin/python26 PyYAML config(ansible) = 0.8-0.git201209240523.el5 python(abi) = 2.6 python26-jinja2 python26-paramiko

Which is going to be the case for any RH/CentOS 5 box we install it on in our environment. And it now installs:

[root@linuxd2 ansible]# rpm -Uvh rpm-build/ansible-0.8-0.git201209240523.el5.noarch.rpm  
Preparing… ########################################### [100%]  
1:ansible ########################################### [100%]  
[root@linuxd2 ansible]#

Obviously this hard-coding isn’t ideal, and as RH/CentOS 5 boxes get increasingly migrated/updated/sunsetted/whatever it’s going to be less and less an issue for you.

Hopefully this experience can help someone else in the same position as me and the OP.

-Rawiri

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 26, 2012, 4:12am UTC](https://forum.ansible.com/t/install-requirements/11715/20 "2012-09-26T04:12:22Z")

</div>

Ah el 5 not 6. Yeah do not cross the streams. Thankfully el 5 node management is simple. Typically most are running ansible from a newer box even if contacting older hosts.

– Michael

[Next page](https://forum.ansible.com/t/install-requirements/11715.md?page=2)
