12.2. 导入自定义 OSTree 内容
除了从红帽 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 分支:
- latest Only - 仅同步最新的 OSTree 分支。
- 所有 History - 同步所有 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"
为 OSTree 创建存储库:
# hammer repository create \ --name "Custom OSTree" \ --content-type "ostree" \ --url "http://www.example.com/rpm-ostree/" \ --product "OSTree Content" \ --organization "My_Organization"
同步存储库:
# hammer repository synchronize \ --name "Custom OStree" \ --product "OSTree Content" \ --organization "My_Organization"