被pipe节点上的sS SFTP子系统是否需要Ansible工作?

当我运行:

ansible all -a "/bin/echo hello" -u myuser 

我回头:

 mydomain.myhost.com | FAILED => failed to open a SFTP connection (Channel closed.) 

SFTP子系统在我试图连接的被pipe节点上被禁用。

受pipe节点上是否需要SFTP? Ansible文档没有具体提到SFTP: http ://docs.ansible.com/intro_installation.html#managed-node-requirements

我试图在ansible.cfg中设置这个值 :

 scp_if_ssh=True 

…但没有效果 (感谢弗雷德魔术奇迹狗的build议 。)

我也确保了我的非交互式shell不会像这里所说的那样产生任何输出。

这就是我最终做的事情:

  1. 复制/etc/ansible/ansible.cfg~/.ansible.cfg
  2. 编辑~/.ansible.cfg
  3. #scp_if_ssh = False更改为scp_if_ssh = True
  4. 添加了ssh_args =[ssh_connection]部分。
  5. -c SSH标志运行我的命令

感谢弗雷德魔术奇迹犬指引我在正确的方向。

是的,无能取决于能够将文件传输到远程机器。 它使用sftp默认执行此操作。 你可以覆盖这个使用scp使用

 scp_if_ssh Occasionally users may be managing a remote system that doesn't have SFTP enabled. If set to True, we can cause scp to be used to transfer remote files instead: scp_if_ssh=False There's really no reason to change this unless problems are encountered, and then there's also no real drawback to managing the switch. Most environments support SFTP by default and this doesn't usually need to be changed. 

以上信息摘自本页:

http://docs.ansible.com/intro_configuration.html#openssh-specific-settings