ngine_io.cloudstack.cs_pod 模块 – 管理基于 Apache CloudStack 的云上的 Pod。

注意

此模块是 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_pod

ngine_io.cloudstack 0.1.0 中的新增功能

概要

  • 创建、更新、删除 Pod。

要求

以下要求需要在执行此模块的主机上满足。

  • python >= 2.6

  • cs >= 0.9.0

参数

参数

注释

api_http_method

字符串

用于查询 API 端点的 HTTP 方法。

如果未给出,则会考虑 CLOUDSTACK_METHOD 环境变量。

选项

  • "get" ←(默认)

  • "post"

api_key

字符串 / 必需

CloudStack API 的 API 密钥。

如果未给出,则会考虑 CLOUDSTACK_KEY 环境变量。

api_secret

字符串 / 必需

CloudStack API 的密钥。

如果未设置,则会考虑 CLOUDSTACK_SECRET 环境变量。

api_timeout

整数

HTTP 超时(以秒为单位)。

如果未给出,则会考虑 CLOUDSTACK_TIMEOUT 环境变量。

默认: 10

api_url

字符串 / 必需

CloudStack API 的 URL,例如 https://cloud.example.com/client/api

如果未给出,则会考虑 CLOUDSTACK_ENDPOINT 环境变量。

api_verify_ssl_cert

字符串

验证 CA 授权证书文件。

如果未给出,则会考虑 CLOUDSTACK_VERIFY 环境变量。

end_ip

字符串

Pod 的结束 IP 地址。

gateway

字符串

Pod 的网关。

state=present 时为必需

id

字符串

现有 Pod 的 UUID。

name

字符串 / 必需

Pod 的名称。

netmask

字符串

Pod 的网络掩码。

state=present 时为必需

start_ip

字符串

Pod 的起始 IP 地址。

state=present 时为必需

state

字符串

Pod 的状态。

选项

  • "present" ←(默认)

  • "enabled"

  • "disabled"

  • "absent"

validate_certs

布尔值

在 ngine_io.cloudstack 2.4.0 中添加

如果为 false,则不会验证 SSL 证书。

如果未给出,则会考虑 CLOUDSTACK_DANGEROUS_NO_TLS_VERIFY 环境变量。

这仅应在个人控制的使用自签名证书的站点上使用。

选项

  • false

  • true ←(默认)

zone

字符串 / 必需

Pod 所属区域的名称。

注释

注意

  • 有关 CloudStack 模块的详细指南,请参阅CloudStack 云指南

  • 此模块支持检查模式。

示例

- name: Ensure a pod is present
  ngine_io.cloudstack.cs_pod:
    name: pod1
    zone: ch-zrh-ix-01
    start_ip: 10.100.10.101
    gateway: 10.100.10.1
    netmask: 255.255.255.0

- name: Ensure a pod is disabled
  ngine_io.cloudstack.cs_pod:
    name: pod1
    zone: ch-zrh-ix-01
    state: disabled

- name: Ensure a pod is enabled
  ngine_io.cloudstack.cs_pod:
    name: pod1
    zone: ch-zrh-ix-01
    state: enabled

- name: Ensure a pod is absent
  ngine_io.cloudstack.cs_pod:
    name: pod1
    zone: ch-zrh-ix-01
    state: absent

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

allocation_state

字符串

Pod 的状态。

返回: 成功

示例: "Enabled"

end_ip

字符串

Pod 的结束 IP。

返回: 成功

示例: "10.100.1.254"

gateway

字符串

Pod 的网关。

返回: 成功

示例: "10.100.1.1"

id

字符串

Pod 的 UUID。

返回: 成功

示例: "04589590-ac63-4ffc-93f5-b698b8ac38b6"

name

字符串

Pod 的名称。

返回: 成功

示例: "pod01"

netmask

字符串

Pod 的子网掩码。

返回: 成功

示例: "255.255.255.0"

start_ip

字符串

Pod 的起始 IP 地址。

返回: 成功

示例: "10.100.1.101"

zone

字符串

Pod 所在的区域名称。

返回: 成功

示例: "ch-gva-2"

作者

  • René Moser (@resmo)