Bug 1334097

Summary: ansible fails when running Task [setup]
Product: [Fedora] Fedora Reporter: Jan Chaloupka <jchaloup>
Component: ansibleAssignee: Kevin Fenzi <kevin>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: high    
Version: 23CC: a.badger, athmanem, kevin, kupo, maxim, toromoti, wusui
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-2.1.0.0-1.fc23 ansible-2.1.0.0-1.el7 ansible-2.1.0.0-1.fc22 ansible-2.1.0.0-1.el6 ansible-2.1.0.0-1.fc24 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-31 19:57:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Chaloupka 2016-05-08 11:32:24 UTC
Description of problem:
When running ansible playbook from [1], ansible fails on facts collection about hosts:

ERROR! SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

[1] https://github.com/kubernetes/contrib/blob/master/ansible/setup.sh

Version-Release number of selected component (if applicable):
ansible-2.0.2.0-1.fc23.noarch

How reproducible:
always

Steps to Reproduce:
Can provide steps if necessary. It takes some effort to create cluster and update ansible vars.

Additional info:
The issues is reported upstream and already with fix [1].

Recommendation is to uncomment scp_if_ssh = True line in /etc/ansible/ansible.cfg.

It is worth considering to uncomment the line by default.

[1] https://github.com/ansible/ansible/issues/13401

Comment 1 Kevin Fenzi 2016-05-09 19:09:24 UTC
I'm checking with upstream to see if changing that config option has undesireable side effects or if there's some idea of a actual fix landing.

Comment 2 Toshio Ernie Kuratomi 2016-05-13 16:13:11 UTC
tldr; code fix proposed in: https://github.com/ansible/ansible/pull/15829

After a few days of discussing this we have three workarounds and a potential patch to actually fix the issue.

The three workarounds are:
* scp_if_ssh = True  (Some sites do not have scp so this won't work there.  bcoca thinks scp is less resistant to errors during transport of the data than sftp so he thinks it's only a workaround, not something we should change by default).  If you're site has scp but not sftp then you should not suffer from this.
* sftp_batch_mode = False (this can lead to cornercases where sftp will fail while copying a file but not alert ansible to the fact.  So ansible will report that the task succeeded but in reality it will have failed.  This is the case I know that this cornercase applies:

$ touch /var/tmp/download
$ chmod a-w /var/tmp/download
$ ansible remotehost -m fetch -a 'src=/etc/fedora-release dest=/var/tmp/download flat=yes'

* Use ansible_connection=paramiko instead of ansible_connection=ssh for this transfer.

https://github.com/ansible/ansible/pull/15829 has a proposed fix.  Setting -oBatchMode=no when using -b tells sftp to prompt for a password even though it takes a batch file (and as a side effect gives more error messages).  This appears to have no drawbacks.  We're going to test and if all goes well, merge that for the 2.1 release.  It should be easy to backport if we're anxious to get it into the Fedora package prior to upstream releasing 2.1.0.

Comment 3 Fedora Update System 2016-05-25 16:19:50 UTC
ansible-2.1.0.0-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-1f9a2eb8d7

Comment 4 Fedora Update System 2016-05-25 16:20:09 UTC
ansible-2.1.0.0-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d31dacfabf

Comment 5 Fedora Update System 2016-05-25 16:20:25 UTC
ansible-2.1.0.0-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5a1e887dfc

Comment 6 Fedora Update System 2016-05-25 16:20:42 UTC
ansible-2.1.0.0-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-aceff68672

Comment 7 Fedora Update System 2016-05-25 16:21:00 UTC
ansible-2.1.0.0-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-9b87ab9c77

Comment 8 Fedora Update System 2016-05-26 04:53:46 UTC
ansible-2.1.0.0-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-9b87ab9c77

Comment 9 Fedora Update System 2016-05-26 05:01:05 UTC
ansible-2.1.0.0-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-aceff68672

Comment 10 Fedora Update System 2016-05-26 05:01:28 UTC
ansible-2.1.0.0-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-1f9a2eb8d7

Comment 11 Fedora Update System 2016-05-26 11:46:40 UTC
ansible-2.1.0.0-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d31dacfabf

Comment 12 Fedora Update System 2016-05-26 11:47:30 UTC
ansible-2.1.0.0-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5a1e887dfc

Comment 13 Fedora Update System 2016-05-31 19:56:56 UTC
ansible-2.1.0.0-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2016-06-10 06:48:06 UTC
ansible-2.1.0.0-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2016-06-12 22:52:41 UTC
ansible-2.1.0.0-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2016-06-13 03:18:58 UTC
ansible-2.1.0.0-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2016-06-18 18:58:04 UTC
ansible-2.1.0.0-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Warren 2018-11-29 00:49:43 UTC
I ran into this problem on Openshift 3.11.  Exporting ANSIBLE_SCP_IF_SSH=y fixed this.

Comment 19 Warren 2018-11-29 00:49:51 UTC
I ran into this problem on Openshift 3.11.  Exporting ANSIBLE_SCP_IF_SSH=y fixed this.