Install requirements

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

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

Regards

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

Looks like you are not using python 2.6

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

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
   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
      $ 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,

        -JP

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

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

Regards

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

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.
  

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

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.

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.

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

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?

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

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

You could modify your PATH or use virtualenv.

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

__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

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

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

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.

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

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

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