ngine_io.cloudstack.cs_role 模块 – 管理基于 Apache CloudStack 云的用户角色。
注意
此模块是 ngine_io.cloudstack 集合 (版本 2.5.0) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install ngine_io.cloudstack
。您需要其他需求才能使用此模块,有关详细信息,请参阅 需求。
要在 playbook 中使用它,请指定:ngine_io.cloudstack.cs_role
。
ngine_io.cloudstack 0.1.0 中的新增功能
概要
创建、更新、删除用户角色。
需求
执行此模块的主机需要以下需求。
python >= 2.6
cs >= 0.9.0
参数
参数 |
注释 |
---|---|
用于查询 API 端点的 HTTP 方法。 如果没有给出,则考虑 选项
|
|
CloudStack API 的 API 密钥。 如果没有给出,则考虑 |
|
CloudStack API 的密钥。 如果没有设置,则考虑 |
|
HTTP 超时(秒)。 如果没有给出,则考虑 默认值: |
|
CloudStack API 的 URL,例如 https://cloud.example.com/client/api。 如果没有给出,则考虑 |
|
验证 CA 权威证书文件。 如果没有给出,则考虑 |
|
角色描述。 |
|
角色名称。 |
|
角色类型。 仅在创建时考虑。 选项
|
|
角色状态。 选项
|
|
角色ID。 如果提供,则使用 *uuid* 作为键。 |
|
如果为 如果没有给出,则考虑 这应该只在使用自签名证书的个人控制站点上使用。 选项
|
备注
注意
有关 cloudstack 模块的详细指南,请参阅 CloudStack 云指南。
此模块支持检查模式。
示例
- name: Ensure an user role is present
ngine_io.cloudstack.cs_role:
name: myrole_user
- name: Ensure a role having particular ID is named as myrole_user
ngine_io.cloudstack.cs_role:
name: myrole_user
id: 04589590-ac63-4ffc-93f5-b698b8ac38b6
- name: Ensure a role is absent
ngine_io.cloudstack.cs_role:
name: myrole_user
state: absent
返回值
常见的返回值已在此处记录 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
角色描述。 返回:成功 示例: |
|
角色的 UUID。 返回:成功 示例: |
|
角色名称。 返回:成功 示例: |
|
角色类型。 返回:成功 示例: |