When using Ansible 1.9.2 installed from packages (via pkg), setting "ansible_python_interpreter" in hosts is ignored. When using Ansible 1.9.2 installed using pip, it works. I'm using a custom hosts file, not /usr/local/etc/ansible/hosts. The hosts file contains one line: centos_host ansible_python_interpreter=/usr/bin/python The remote host is Amazon Linux, which is based on CentOS. When running 'ansible all -m ping', I get: /bin/sh: /usr/local/bin/python2.7: No such file or directory Tried setting that in various other places including ansible.cfg, same thing. Setting other variables on the same line, like "ansible_ssh_user", works.
I can't seem to reproduce this with the information provided: Name : ansible Version : 1.9.2 $ ansible -i /tmp/hosts all -m ping 127.0.0.1 | FAILED >> { "failed": true, "msg": "/bin/sh: /usr/bin/python: not found\r\nOpenSSH_6.6.1p1, OpenSSL 1.0.1p-freebsd 9 Jul 2015\r\ndebug1: Reading configuration data /home/lifanov/.ssh/config\r\ndebug1: /home/lifanov/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux_client_request_session: master session id: 2\r\nShared connection to 127.0.0.1 closed.\r\n", "parsed": false } c6.test | success >> { "changed": false, "ping": "pong" } /tmp/hosts: 127.0.0.1 ansible_python_interpreter=/usr/bin/python [centos] c6.test [centos:vars] ansible_python_interpreter=/usr/bin/python Can you provide a copy of your hosts file please?
Hm. I can't reproduce it on a new machine either. On the one I usually use it definitely fails, but that one has been around for a while. Must be some combination of packages. I'll see if I can isolate it, but if you don't hear anything from me in a week or so, I probably won't have any news.
Can't reproduce. Installed a new system with the same packages as the failing one, but the new system works as expected. Don't know where else to look, at this point it seems to be caused by some particularity on this one machine.
Thanks! Please let me know if you find a way to reproduce the problem.
To submitter, was there any luck reproducing the issue? Either with Ansible 1.9.2 or Ansible 1.9.3?
There was a related issue, addressed in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202799 USES=shebangfix changed default python interpreter from $LOCALBASE/python to $LOCALBASE/python2.7 a while ago and at some point official packages were rebuilt, which is when people started noticing it. The sysutils/ansible 1.9.3 version already has the fix.
(In reply to Nikolai Lifanov from comment #6) Thanks for the feedback! The USES=shebangfix was added over a year ago in https://svnweb.FreeBSD.org/changeset/ports/365076 for the 1.7.1 update. I'm not sure when the Python change for python->python2.7 may have happened. If 1.9.3 is required for the fix, should that update be merged to the quarterly branch before I can legitimately call this PR as fixed?
The earliest fix (and the candidate for stable branch) is in r396055. The fixed package version is 1.9.2_1. The 1.9.3 just contains the fix. Having said this, 1.9.3 should be backwards-compatible and also merge-worthy. I approve either action, at your discretion.
I wasn't able to reproduce on a different host, but I installed ansible 1.9.3 on the host that was showing this problem and it all works as expected now, the ping succeeds. Thank you. I'd consider the issue fixed.
1.9.3 update and prior commit has been merged to quarterly in: https://svnweb.FreeBSD.org/changeset/ports/397537 Thanks for the report.