当我跑:
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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。