linux – Ansible的受管节点上是否需要SSH SFTP子系统才能工作?

当我跑:
ansible all -a "/bin/echo hello" -u myuser

我回来了:

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

我正在尝试连接的受管节点上禁用SFTP子系统.

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

我尝试在ansible.cfg中设置this value

scp_if_ssh=True

……但它没有效果. (感谢Fred the Magic Wonder Dog for the suggestion.)

我还确保我的非交互式shell不会产生任何输出as suggested here.

解决方法

是的,ansible取决于能够将文件传输到远程计算机.默认情况下,它使用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

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...