gpt4 book ai didi

ssh - Chef Recipe : automatically type yes if prompted

转载 作者:行者123 更新时间:2023-12-02 14:13:29 24 4
gpt4 key购买 nike

我正在制作 Recipe 以将文件从提供的存储库克隆到节点。这是我的 Recipe :

execute 'clone files from stash' do
command 'git clone <REPOSITORY_DIR> /var/www'
end

但是当我运行这个 chef-client在我的节点上,它返回错误说:
Expected process to exit with [0], but received '128'
---- Begin output of git clone [REPOSITORY_URL] /var/www ----
STDOUT: Cloning into '/var/www'...
STDERR: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

当我尝试手动运行命令时,我得到了这个:
[root@wwwblibli /]# git clone REPO_URL /var/www
Cloning into '/var/www'...
The authenticity of host '[REPO_URL]:8000 ([REPO_IP]:7999)' can't be established.
RSA key fingerprint is xxxx.
RSA key fingerprint is xxxx.
Are you sure you want to continue connecting (yes/no)?

有没有办法自动回复 yes提示时,或任何命令自动将存储库添加到已知主机?

*注意:我已将节点的公钥注册到存储库

最佳答案

使用 git资源,或者可能是 poise_git资源,如果您需要支持部署 key 。它为您处理禁用交互式内容。

关于ssh - Chef Recipe : automatically type yes if prompted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49728820/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com