Bug 202739 - sysutils/ansible 1.9.2: "ansible_python_interpreter" is ignored
Summary: sysutils/ansible 1.9.2: "ansible_python_interpreter" is ignored
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason Unovitch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-29 09:16 UTC by bgdnlp
Modified: 2015-09-22 12:38 UTC (History)
2 users (show)

See Also:
linimon: maintainer-feedback?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bgdnlp 2015-08-29 09:16:20 UTC
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.
Comment 1 Nikolai Lifanov 2015-08-30 04:46:03 UTC
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?
Comment 2 bgdnlp 2015-08-31 04:53:44 UTC
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.
Comment 3 bgdnlp 2015-08-31 06:42:45 UTC
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.
Comment 4 Nikolai Lifanov 2015-08-31 13:46:50 UTC
Thanks! Please let me know if you find a way to reproduce the problem.
Comment 5 Jason Unovitch freebsd_committer freebsd_triage 2015-09-19 19:57:02 UTC
To submitter, was there any luck reproducing the issue?  Either with Ansible 1.9.2 or Ansible 1.9.3?
Comment 6 Nikolai Lifanov 2015-09-20 01:48:47 UTC
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.
Comment 7 Jason Unovitch freebsd_committer freebsd_triage 2015-09-20 14:14:23 UTC
(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?
Comment 8 Nikolai Lifanov 2015-09-20 23:49:36 UTC
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.
Comment 9 bgdnlp 2015-09-21 06:59:37 UTC
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.
Comment 10 Jason Unovitch freebsd_committer freebsd_triage 2015-09-22 12:38:08 UTC
1.9.3 update and prior commit has been merged to quarterly in:
https://svnweb.FreeBSD.org/changeset/ports/397537

Thanks for the report.