14.5. 从自定义文件类型存储库下载文件到主机
您可以使用 curl -O
将文件下载到客户端,如果选择了 Unprotected 选项,则可以通过 HTTP 将文件下载到客户端。
先决条件
- 您有一个自定义文件类型存储库。更多信息请参阅 第 14.3 节 “创建自定义文件类型存储库”。
- 您知道要从文件类型存储库下载至客户端的文件名。
要使用 HTTPS,您需要在客户端上的以下证书:
-
katello-server-ca.crt
.如需更多信息,请参阅为 Red Hat Satellite 用户配置身份验证 中的 导入 Katello root CA 证书。 - 机构调试证书。如需更多信息,请参阅管理 Red Hat Satellite 中的 创建机构调试证书。
-
流程
- 在 Satellite Web UI 中,进入到 Content > Products。
- 按名称选择自定义产品。
- 按名称选择文件类型存储库。
- 确保选中 Unprotected 复选框,以访问通过 HTTP 发布的存储库。
- 复制 Published At URL。
在您的客户端上,从 Satellite 服务器下载该文件:
对于 HTTPS:
curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
# curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于 HTTP:
curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
# curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
CLI 过程
列出文件类型存储库。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 显示存储库信息。
hammer repository info \ --name "My_Files" \ --organization-id My_Organization_ID \ --product "My_File_Product"
# hammer repository info \ --name "My_Files" \ --organization-id My_Organization_ID \ --product "My_File_Product"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果启用了 未保护,输出类似如下:
Publish Via HTTP: yes Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/
Publish Via HTTP: yes Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果没有启用 未保护,输出类似如下:
Publish Via HTTP: no Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/
Publish Via HTTP: no Published At: https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在您的客户端上,从 Satellite 服务器下载该文件:
对于 HTTPS:
curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
# curl \ --cacert ./_katello-server-ca.crt \ --cert ./_My_Organization_key-cert.pem \ --remote-name \ https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于 HTTP:
curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
# curl \ --remote-name \ http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
Copy to Clipboard Copied! Toggle word wrap Toggle overflow