theforeman.foreman.compute_attribute 模块 – 管理计算属性
注意
此模块是 theforeman.foreman 集合(版本 4.2.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install theforeman.foreman
。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:theforeman.foreman.compute_attribute
。
theforeman.foreman 1.0.0 版本新增
概要
管理计算属性
此测试版可以创建和更新计算属性
别名:foreman_compute_attribute
要求
执行此模块的主机需要以下要求。
requests
参数
参数 |
注释 |
---|---|
计算配置文件的名称 |
|
计算资源的名称 |
|
访问 Foreman 服务器的用户的密码。 如果任务中未指定该值,则将改用环境变量 |
|
Foreman 服务器的 URL。 如果任务中未指定该值,则将改用环境变量 |
|
实体的状态 选择
|
|
访问 Foreman 服务器的用户名。 如果任务中未指定该值,则将改用环境变量 |
|
是否验证 Foreman 服务器的 TLS 证书。 如果任务中未指定该值,则将改用环境变量 选择
|
|
包含 vm_attrs 数据的哈希 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 完全 |
可以在 check_mode 中运行并返回更改状态预测,而无需修改实体 |
|
支持: 完全 |
当处于 diff 模式时,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息 |
示例
- name: "Create compute attribute"
theforeman.foreman.compute_attribute:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
compute_profile: "Test Compute Profile"
compute_resource: "Test Compute Resource"
vm_attrs:
memory_mb: '2048'
cpu: '2'
state: present
- name: "Update compute attribute"
theforeman.foreman.compute_attribute:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
compute_profile: "Test Compute Profile"
compute_resource: "Test Compute Resource"
vm_attrs:
memory_mb: '1024'
cpu: '1'
state: present
返回值
常见的返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
受影响实体的最终状态按其类型分组。 已返回: 成功 |
|
计算属性列表。 已返回: 成功 |
|
给定计算配置文件和资源组合的有效属性。 已返回: 成功 |
|
关联计算配置文件的数据库 ID。 已返回: 成功 |
|
关联计算配置文件的名称。 已返回: 成功 |
|
关联计算资源的数据库 ID。 已返回: 成功 |
|
关联计算资源的名称。 已返回: 成功 |
|
计算属性的创建日期。 已返回: 成功 |
|
计算属性的数据库 ID。 已返回: 成功 |
|
为计算属性生成的友好名称。 已返回: 成功 |
|
计算资源的提供程序类型名称。 已返回: 成功 |
|
上次更改计算属性的日期。 已返回: 成功 |
|
已配置的属性。 已返回: 成功 |