当我跑步时:
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#托管-节点-需求
我尝试在这个值中设置ansible.cfg:
scp_if_ssh=True...but无明显影响。(多亏了建议中的神奇犬弗雷德。)
我还确保了我的非交互式shell不会产生任何输出正如这里所建议的。
发布于 2014-04-15 19:05:05
以下是我最后所做的:
/etc/ansible/ansible.cfg复制到~/.ansible.cfg~/.ansible.cfg.#scp_if_ssh = False改为scp_if_ssh = Truessh_args =添加到[ssh_connection]部分。-c SSH标志运行我的命令感谢神奇的狗弗雷德为我指明了正确的方向。
发布于 2014-03-14 18:14:15
是的,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.上述资料摘自本页:
https://serverfault.com/questions/582171
复制相似问题