使用用户凭据通过Chef配方从远程http服务器下载文件

时间:2017-08-15 14:28:37

标签: chef chef-recipe chef-solo

我正在尝试从大厨食谱下载远程文件。如果服务器不需要用户名和密码,我可以使用以下命令下载文件。

remote_file "/destination-folder/large-file.tar.gz" do source "http://www.example.org/large-file.tar.gz

但我的服务器需要用户名和密码来下载文件。

如何在上面的厨师代码中加入用户名和密码?

1 个答案:

答案 0 :(得分:2)

source 'https://username:password@www.example.org/whatever',也不要忘记sensitive true