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。您需要更多要求才能使用此模块,请参阅 要求 以了解详情。
要在剧本中使用它,请指定: 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
返回值
此处记录了常见的返回值 此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 角色的描述。 返回值: success 示例:  | |
| 角色的 UUID。 返回值: success 示例:  | |
| 角色的名称。 返回值: success 示例:  | |
| 角色的类型。 返回值: success 示例:  | 
