cloudscale_ch.cloud.server_group 模块 – 管理 cloudscale.ch IaaS 服务上的服务器组
注意
此模块是 cloudscale_ch.cloud 集合 (版本 2.4.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install cloudscale_ch.cloud。
要在 playbook 中使用它,请指定: cloudscale_ch.cloud.server_group。
cloudscale_ch.cloud 1.0.0 中的新增功能
概要
- 创建、更新和删除服务器组。 
别名:cloudscale_server_group
参数
| 参数 | 注释 | 
|---|---|
| 调用 cloudscale.ch API 的超时时间(秒)。 这也可以在  默认值:  | |
| cloudscale.ch API 令牌。 这也可以在  | |
| cloudscale.ch API URL。 这也可以在  默认值:  | |
| 服务器组的名称。 需要 *name* 或 *uuid* 之一。这些选项是互斥的。 | |
| 服务器组的状态。 选项 
 | |
| 与服务器组关联的标签。将其设置为  | |
| 服务器组的类型。 默认值:  | |
| 服务器组的 UUID。 需要 *name* 或 *uuid* 之一。这些选项是互斥的。 | |
| 服务器组的区域代码(例如  | 
备注
注意
- 所有操作均使用 cloudscale.ch 公共 API v1 执行。 
- 详情请参阅完整的 API 文档: https://www.cloudscale.ch/en/api/v1。 
- 所有操作都需要有效的 API 令牌。您可以使用 cloudscale.ch 控制面板在 https://control.cloudscale.ch 创建任意数量的令牌。 
示例
---
- name: Ensure server group exists
  cloudscale_ch.cloud.server_group:
    name: my-name
    type: anti-affinity
    api_token: xxxxxx
- name: Ensure server group in a specific zone
  cloudscale_ch.cloud.server_group:
    name: my-rma-group
    type: anti-affinity
    zone: lpg1
    api_token: xxxxxx
- name: Ensure a server group is absent
  cloudscale_ch.cloud.server_group:
    name: my-name
    state: absent
    api_token: xxxxxx
返回值
常见返回值已在此处记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 获取有关此服务器组详细信息的 API URL 返回:如果可用 示例:  | |
| 服务器组的显示名称 返回:始终 示例:  | |
| 属于服务器组的服务器列表。 返回:如果可用 示例:  | |
| 服务器组的状态。 返回:始终 示例:  | |
| 与服务器组关联的标签。 返回:成功 示例:  | |
| 服务器组的类型 返回:如果可用 示例:  | |
| 此服务器的唯一标识符 返回:始终 示例:  | |
| 服务器组的区域 返回:成功 示例:  | 
