theforeman.foreman.content_upload 模块 – 将内容上传到存储库
注意
此模块是 theforeman.foreman 集合 (版本 4.2.0) 的一部分。
如果您正在使用 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman
。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。
要在剧本中使用它,请指定:theforeman.foreman.content_upload
。
theforeman.foreman 1.0.0 中的新增功能
概要
允许将内容上传到存储库
别名:katello_upload
要求
执行此模块的主机需要以下要求。
python-debian(用于 deb 包上传)
requests
rpm(用于 rpm 上传)
参数
参数 |
注释 |
---|---|
实体所在的组织 |
|
OSTree 存档中存储库的名称。 对于 OSTree 上传是必需的。 |
|
访问 Foreman 服务器的用户密码。 如果任务中未指定该值,则将使用环境变量 |
|
存储库所在的 Product |
|
要将文件上传到的存储库 |
|
Foreman 服务器的 URL。 如果任务中未指定该值,则将使用环境变量 |
|
要上传的文件(在远程/目标机器上) |
|
访问 Foreman 服务器的用户名。 如果任务中未指定该值,则将使用环境变量 |
|
是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定该值,则将使用环境变量 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完全支持 |
可以在 check_mode 下运行并返回更改状态预测,而无需修改实体 |
|
支持:完全支持 |
在差异模式下,将返回有关已更改内容(或可能需要在 check_mode 下更改的内容)的详细信息 |
备注
注意
目前仅支持上传到 deb、RPM、OSTree 和文件存储库
对于除文件存储库以外的任何内容,都必须安装支持库。请参阅要求。
OSTree 内容上传不是幂等的 - 多次运行将尝试上传内容单元。
示例
- name: "Upload my.rpm"
theforeman.foreman.content_upload:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
src: "my.rpm"
repository: "Build RPMs"
product: "My Product"
organization: "Default Organization"
- name: "Upload ostree-archive.tar"
theforeman.foreman.content_upload:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
src: "ostree_archive.tar"
repository: "My OStree Repository"
product: "My Product"
organization: "Default Organization"
ostree_repository_name: "small"