Some months ago I had a problem installing Ansible at work because of our non-standard Linux setup. setup.py tries to install them to /usr/share regardless of standard --home and --root overrides. More details in the pull request here:
While addressing the issue of alternate install paths wasn't argued, that patch got rejected because my approach was not satisfactory. Fair enough. I tried. Is anything happening to address this though? What is a better way of addressing this than supporting the standard switches in distutils?
I’m still standing by my original comments in the pull request.
Ansible is a systems management app that happens to be written in Python, so “setup.py” isn’t really something that is a supported way of installing things.
Most users will be using the OS packages or running from source, and I don’t really see the need to support some arguments that only 2 or 3 python developers here know about.
“make install” is never a good way to install software. You really want to use OS packages.
Setup.py can be used to create a tarball and you’re welcome to do what you want with the contents inside that tarball.
Why don’t you install in it a virtualenv (http://www.virtualenv.org/en/latest/)? This is the most safe and flexible way for using, deploying and installing various versions of Python modules.
On the system just install python, pip and virtualenv, than use as a non-root user:
cd my_ansible_folder
source venv/bin/activate
ansible-playbook site.yml
If you really want to install it on the system you can also do this with a Python package manager like pip (just don’t source the venv, but you need to be root).