Ansible:SSH 错误:unix_listener:Unix 域套接字太长 [英] Ansible: SSH Error: unix_listener: too long for Unix domain socket
问题描述
这是一个已知问题,我找到了解决方案,但对我不起作用.
This is a known issue and I found a solution but it's not working for me.
首先我有:
fatal: [openshift-node-compute-e50xx] => SSH Error: ControlPath too long
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
所以我创建了一个~/.ansible.cfg
.其内容:
So I created a ~/.ansible.cfg
. The content of it:
[ssh_connection]
control_path=%(directory)s/%%h‐%%r
但是在重新运行我的 ansible 之后,我仍然有一个关于太长"的错误.
But after rerunning my ansible I stil have an error about 'too long'.
fatal: [openshift-master-32axx] => SSH Error: unix_listener: "/Users/myuser/.ansible/cp/ec2-xx-xx-xx-xx.eu-central-1.compute.amazonaws.com-centos.AAZFTHkT5xXXXXXX" too long for Unix domain socket
while connecting to 52.xx.xx.xx:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
为什么还是太长了?
推荐答案
限制为 104 或 108 个字符.(我在网上找到了不同的说法)
The limit is 104 or 108 characters. (I found different statements on the web)
您在错误消息中删除了一些敏感信息,因此不清楚您的路径实际有多长.
You XXXed out some sensitive information in the error message so it's not clear how long your path actually is.
我猜 %(directory)s
被替换为用户文件夹中的 .ansible
目录.删除它并直接使用您的用户文件夹将为您节省 12 个字符:
I guess %(directory)s
is replaced with the .ansible
directory in your users folder. Removing that and using directly your user folder would save you 12 characters:
control_path=~/%%h‐%%r
当然,这会用控制套接字向您的主目录发送垃圾邮件.
根据用户名的实际长度,您可以查看是否可以创建另一个目录或在任何地方找到更短的路径.例如,我使用 ~/.ssh/tmp/%%h_%%r
Depending on the actual length of your username, you could see if you can just create another directory or find a shorter path anywhere. For example, I use ~/.ssh/tmp/%%h_%%r
仅少 3 个字符,但已经足够了.
Only 3 chars less but it's enough.
最后,如果这些都没有帮助,您仍然可以使用 /tmp
来存储套接字.但请注意,在该机器上可以访问 /tmp
的任何人都可以使用您的套接字.
Finally if none of that helps, you still could fall back using /tmp
for storing the sockets. But be aware that anyone with access to /tmp
on that machine might be able to use your sockets then.
这篇关于Ansible:SSH 错误:unix_listener:Unix 域套接字太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!