community.general.manageiq_policies 模块 – 在 ManageIQ 中管理资源策略配置文件
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.general
。您需要其他要求才能使用此模块,有关详细信息,请参阅 需求。
要在 playbook 中使用它,请指定: community.general.manageiq_policies
。
概要
manageiq_policies 模块支持在 ManageIQ 中添加和删除策略配置文件。
需求
在执行此模块的主机上需要以下需求。
manageiq-client https://github.com/ManageIQ/manageiq-api-client-python/
参数
参数 |
注释 |
---|---|
ManageIQ 连接配置信息。 |
|
CA 证书包文件或目录的路径。 |
|
ManageIQ 密码。如果已设置,则为 |
|
ManageIQ 令牌。如果已设置,则为 |
|
ManageIQ 环境 URL。如果已设置,则为 |
|
ManageIQ 用户名。如果已设置,则为 |
|
是否应为 HTTPS 请求验证 SSL 证书。 选项
|
|
字典列表,每个字典都包含 policy_profile 如果 |
|
应为其[取消]分配配置文件的资源的 ID。 如果未设置 |
|
应为其[取消]分配配置文件的资源的名称。 如果未设置 |
|
应为其[取消]分配配置文件的资源的类型。 选项
|
|
选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:不支持 |
可以在 |
|
支持:不支持 |
在差异模式下,将返回有关已更改内容(或可能需要在 |
示例
- name: Assign new policy_profile for a provider in ManageIQ
community.general.manageiq_policies:
resource_name: 'EngLab'
resource_type: 'provider'
policy_profiles:
- name: openscap profile
manageiq_connection:
url: 'http://127.0.0.1:3000'
username: 'admin'
password: 'smartvm'
validate_certs: false # only do this when you trust the network!
- name: Unassign a policy_profile for a provider in ManageIQ
community.general.manageiq_policies:
state: absent
resource_name: 'EngLab'
resource_type: 'provider'
policy_profiles:
- name: openscap profile
manageiq_connection:
url: 'http://127.0.0.1:3000'
username: 'admin'
password: 'smartvm'
validate_certs: false # only do this when you trust the network!
返回值
公共返回值已记录在 此处,以下是此模块独有的字段
键 |
描述 |
---|---|
列出 ManageIQ 中提供商的当前策略配置文件和策略 返回:始终 示例: |