2.7. 使用输入文件添加新红帽内容存储库
在 Red Hat Update Infrastructure 4.2 及更高版本中,您可以使用配置的 YAML 输入文件添加自定义存储库。您可以在 /usr/share/rhui-tools/examples/repo_add_by_file.yaml 目录中找到 RHUA 节点上的 YAML 文件示例模板。
这个功能只在命令行界面(CLI)中可用。
先决条件
- 确保您有访问 RHUA 节点的 root 访问权限。
流程
在 RHUA 节点上,创建一个以下格式的 YAML 输入文件:
# cat /root/example.yaml name: Example_YAML_File repo_ids: - rhel-8-for-x86_64-baseos-eus-rhui-rpms-8.1 - rhel-8-for-x86_64-baseos-eus-rhui-rpms-8.2 - rhel-8-for-x86_64-baseos-eus-rhui-rpms-8.4 - rhel-8-for-x86_64-baseos-eus-rhui-rpms-8.6使用
rhui-manager工具添加输入文件中列出的存储库:# rhui-manager repo add_by_file --file /root/example.yaml --sync_now The name of the repos being added: Example_YAML_File Loading latest entitled products from Red Hat... ... listings loaded Successfully added Red Hat Enterprise Linux 8 for x86_64 - BaseOS - Extended Update Support from RHUI (RPMs) (8.1) (Yum) Successfully added Red Hat Enterprise Linux 8 for x86_64 - BaseOS - Extended Update Support from RHUI (RPMs) (8.2) (Yum) Successfully added Red Hat Enterprise Linux 8 for x86_64 - BaseOS - Extended Update Support from RHUI (RPMs) (8.4) (Yum) Successfully added Red Hat Enterprise Linux 8 for x86_64 - BaseOS - Extended Update Support from RHUI (RPMs) (8.6) (Yum) ... successfully scheduled for the next available timeslot. ... successfully scheduled for the next available timeslot. ... successfully scheduled for the next available timeslot. ... successfully scheduled for the next available timeslot.
验证
在 CLI 中,使用以下命令列出所有已安装的软件仓库,并检查是否已安装了正确的软件仓库:
# rhui-manager repo list-
在 RHUI Management Tool 中,在 Repository Management 屏幕中,按
l列出所有已安装的存储库,并检查是否已安装了正确的存储库。