问题原文
原帖链接 · braveterry · CC BY-SA 3.0
When I run:
ansible all -a "/bin/echo hello" -u myuser
I get back:
mydomain.myhost.com | FAILED => failed to open a SFTP connection (Channel closed.)
The SFTP subsystem is disabled on the managed node I'm trying to connect to.
Is SFTP required on the managed nodes? The Ansible docs don't mention SFTP specifically: http://docs.ansible.com/intro_installation.html#managed-node-requirements
I tried setting this value in ansible.cfg:
scp_if_ssh=True
...but it had no effect. (Thanks to Fred the Magic Wonder Dog for the suggestion.)
I also ensured that my non-interactive shell doesn't produce any output as suggested here.
已采纳解答
原帖链接 · braveterry · CC BY-SA 3.0
Here's what I ended up doing:
- Copied
/etc/ansible/ansible.cfgto~/.ansible.cfg - Edited
~/.ansible.cfg. - Changed
#scp_if_ssh = Falsetoscp_if_ssh = True - Added
ssh_args =to[ssh_connection]section. - Ran my command with
-c SSHflag
Thanks to Fred the Magic Wonder Dog for pointing me in the right direction.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
