Bug 206498 - sysutils/ansible: Tries to feed sh-syntax commands to csh
Summary: sysutils/ansible: Tries to feed sh-syntax commands to csh
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Matthew Seaman
URL:
Keywords: easy, patch, patch-ready, regression
Depends on:
Blocks:
 
Reported: 2016-01-22 16:32 UTC by Matthew Seaman
Modified: 2016-01-22 17:43 UTC (History)
1 user (show)

See Also:
koobs: maintainer-feedback+


Attachments
Derived from upstream commit 8647fdc7f25ba1c707c5333ca1581a1fa0ffe566 (1.68 KB, patch)
2016-01-22 16:32 UTC, Matthew Seaman
no flags Details | Diff
Derived from upstream commit 8647fdc7f25ba1c707c5333ca1581a1fa0ffe566 (2.47 KB, patch)
2016-01-22 16:42 UTC, Matthew Seaman
no flags Details | Diff
ansible backport 8647fdc (2.10 KB, patch)
2016-01-22 16:56 UTC, Nikolai Lifanov
lifanov: maintainer-approval+
Details | Diff
ansible backport 8647fdc (2.50 KB, patch)
2016-01-22 17:03 UTC, Nikolai Lifanov
lifanov: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Seaman freebsd_committer freebsd_triage 2016-01-22 16:32:04 UTC
Created attachment 165964 [details]
Derived from upstream commit 8647fdc7f25ba1c707c5333ca1581a1fa0ffe566

Seems there's a show-stopper bug in the latest ansible port:

% ansible -vvv stingray.fish.adestra.com -m setup
Using /usr/local/etc/ansible/ansible.cfg as config file
<stingray.fish.adestra.com> ESTABLISH SSH CONNECTION FOR USER: None
<stingray.fish.adestra.com> SSH: EXEC ssh -C -q -A -o ControlMaster=auto -o ControlPersist=60s -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/matthew/.ansible/cp/ansible-ssh-%h-%p-%r -tt stingray.fish.adestra.com '( umask 22 && mkdir -p "$( echo ${HOME}/.ansible/tmp/ansible-tmp-1453477395.69-234719990038675 )" && echo "$( echo ${HOME}/.ansible/tmp/ansible-tmp-1453477395.69-234719990038675 )" )'
stingray.fish.adestra.com | UNREACHABLE! => {
"changed": false,
"msg": "ERROR! Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 22 && mkdir -p \"$( echo ${HOME}/.ansible/tmp/ansible-tmp-1453477395.69-234719990038675 )\" && echo \"$( echo ${HOME}/.ansible/tmp/ansible-tmp-1453477395.69-234719990038675 )\" ), exited with result 1: Illegal variable name.\r\n",
"unreachable": true
}

On FreeBSD machines, where root's shell is by default /bin/csh, ansible ends up using that trying to run commands with /bin/sh syntax. Which simply doesn't work.

This has been reported upstream (Issues: #13745, #13882) and this fix has been committed to ansible github:

https://github.com/ansible/ansible/commit/8647fdc7f25ba1c707c5333ca1581a1fa0ffe566

Would it be possible to add this as a patch to the ansible FreeBSD port until the next release comes out?

poudriere testport: OK
Comment 1 Matthew Seaman freebsd_committer freebsd_triage 2016-01-22 16:42:54 UTC
Created attachment 165966 [details]
Derived from upstream commit 8647fdc7f25ba1c707c5333ca1581a1fa0ffe566

* Add PORTREVISION

* Add PATCHDIR to ansible1 slave port to avoid breaking that.
Comment 2 Nikolai Lifanov 2016-01-22 16:56:17 UTC
Created attachment 165967 [details]
ansible backport 8647fdc
Comment 3 Nikolai Lifanov 2016-01-22 16:57:38 UTC
Hi!

The patch you attached is fine, but it bumps PORTREVISION for sysutils/ansible1, which does not need a rebuild. Please see the patch I attached. If it is okay with you, I approve the commit of it.
Comment 4 Nikolai Lifanov 2016-01-22 17:03:24 UTC
Created attachment 165968 [details]
ansible backport 8647fdc

Whoops, patch got truncated.
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-01-22 17:31:22 UTC
A commit references this bug:

Author: matthew
Date: Fri Jan 22 17:30:58 UTC 2016
New revision: 406939
URL: https://svnweb.freebsd.org/changeset/ports/406939

Log:
  Fix default low-level command submission
    -- on FreeBSD root's default shell (/bin/csh) would fail to
       understand the /bin/sh syntax ansible issues.

  Import the fix from upstream.

  PR:		206498
  Submitted by:	matthew
  Approved by:	lifanov@mail.lifanov.com (maintainer)
  Obtained from:	https://github.com/ansible/ansible/commit/8647fdc7f25ba1c707c5333ca1581a1fa0ffe566

Changes:
  head/sysutils/ansible/Makefile
  head/sysutils/ansible/files/extra-patch-8647fdc
  head/sysutils/ansible1/Makefile
Comment 6 Matthew Seaman freebsd_committer freebsd_triage 2016-01-22 17:31:48 UTC
Committed, thanks!
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-22 17:34:10 UTC
Reporter is Committer, assign accordingly

@Matthew, can you obsolete the attachment that wasn't committed please, so it's clear which one was.