In re the /usr/share write failure, the /usr/share/ansible path is hardcoded into lib/ansible/constants.py in the case that you aren't in a virtualenv (line 67 of [1] for v1.1). That causes major problems if you try to install ansible in a custom location, for example, with pyenv[2].
There's an open issue about this now [3], though in the past when this has come up, Michael didn't seem to understand the problem and closed the report [4]. I think one of the best features of Ansible is that it's a system configuration tool that doesn't expect or require you to be root. Except for this one hangup that is. But I'm not a Python coder, so rather than try to learn Python best-practices for finding the appropriate relative path for a custom-installed python in order to submit a fix for a problem the project lead didn't seem to think was an issue, I have worked around the problem (for use with pyenv) by using the code at this gist: https://gist.github.com/daveadams/8916625 Good luck. -dave [1] https://github.com/ansible/ansible/blob/v1.1/lib/ansible/constants.py [2] https://github.com/yyuu/pyenv [3] https://github.com/ansible/ansible/issues/5814 [4] https://github.com/ansible/ansible/issues/4831 On Sun, Feb 9, 2014 at 2:43 AM, Sam <[email protected]> wrote: > Hello. > > Just trying out Ansible, but unfortunately failing. > > Python is installed in /opt/local/bin. Python isn't installed elsewhere on > the system. > Config files are in /opt/local/etc/ansible. > /opt/local/etc/ansible/hosts has only localhost IP. > > Test failing as listed below. > > Ansible is Version 1.1 > > *# ansible -vvv all -m ping --private-key=~/.ssh/root@localhost* > <127.0.0.1> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 127.0.0.1 > <127.0.0.1> EXEC /bin/sh -c 'mkdir -p > $HOME/.ansible/tmp/ansible-1391933360.58-270511702358723 && echo > $HOME/.ansible/tmp/ansible-1391933360.58-270511702358723' > <127.0.0.1> REMOTE_MODULE ping > <127.0.0.1> PUT /tmp/tmp5eWoMl TO > /root/.ansible/tmp/ansible-1391933360.58-270511702358723/ping > <127.0.0.1> EXEC /bin/sh -c ' /usr/bin/python > /root/.ansible/tmp/ansible-1391933360.58-270511702358723/ping; rm -rf > /root/.ansible/tmp/ansible-1391933360.58-270511702358723/ >/dev/null 2>&1' > 127.0.0.1 | FAILED >> { > "failed": true, > "msg": "/bin/sh[1]: */usr/bin/python*: not found [No such file or > directory]\n", > "parsed": false > } > > How do I get Ansible to use the Python I have on the system? > > TIA. > > Sam > > > PS. Also having problems installing Ansible via PIP. > > # pip install ansible > > # pip install ansible --root / > > As /usr is not writable, above fail with > > creating /usr/share/ansible > > > error: could not create '/usr/share/ansible': Read-only file system > > > > If I use > > # pip install ansible --root /opt/local > > files get installed in /opt/local/opt/local rather than /opt/local, which > is definitely a bug. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
