12.2. 导入自定义 OSTree 内容
除了从 Red Hat CDN 导入 OSTree 内容外,您还可以从其他源导入内容。这需要一个公布的 HTTP 位置才能导入 OSTree。
流程
要导入自定义 OSTree 内容,请完成以下步骤:
- 在 Satellite Web UI 中,进入到 Content > Products 并点 Create Product。
- 在 Name 字段中输入 OSTree 内容的名称。这会自动填充 Label 字段。
- 可选:在 GPG Key 字段中,为整个产品输入 GPG 密钥。
- 从 Sync Plan 菜单,选择要与产品关联的同步计划。
- 在 Description 字段中,输入产品的描述,然后点 Save。
- 创建产品后,单击 Create Repository。
- 在 Name 字段中输入存储库的名称。这会自动填充 Label 字段。
-
从 Type 列表中,选择
ostree
。 -
在 URL 字段中,输入要用作源的 registry 的 URL。例如
http://www.example.com/rpm-ostree/
。 在 Upstream Sync Policy 菜单中,选择以下策略之一来同步此存储库的 OSTree 分支:
- 仅限 最新 - 仅同步最新的 OSTree 分支。
- 所有历史 - 同步所有 OSTree 分支。
- Custom - 同步自定义数量的 OSTree 分支。在以下字段中输入所需号。
- 点击 Save。
- 完成存储库创建后,选择新存储库,然后单击 Sync Now 以启动同步过程。
查看同步状态:
- 在 Satellite Web UI 中,进入到 Content > Sync Status,再展开您要查看的条目。
对于 CLI 用户
为自定义 OSTree 内容创建一个产品:
hammer product create \ --name "Custom OSTree Content" \ --sync-plan "Example_Plan" \ --description "OSTree Content" \ --organization "My_Organization"
# hammer product create \ --name "Custom OSTree Content" \ --sync-plan "Example_Plan" \ --description "OSTree Content" \ --organization "My_Organization"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 为 OSTree 创建存储库:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 同步存储库:
hammer repository synchronize \ --name "OSTree" \ --product "OSTree Content" \ --organization "My_Organization"
# hammer repository synchronize \ --name "OSTree" \ --product "OSTree Content" \ --organization "My_Organization"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow