ngine_io.cloudstack.cs_iso 模块 – 管理基于 Apache CloudStack 云的 ISO 镜像。

注意

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

ngine_io.cloudstack 0.1.0 中的新增功能

概要

  • 注册和删除 ISO 镜像。

要求

执行此模块的主机需要以下要求。

  • python >= 2.6

  • cs >= 0.9.0

参数

参数

注释

account

字符串

ISO 相关的账户。

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 环境变量。

bootable

布尔值

注册 ISO 为可引导的。仅在 *state* 为 present 时使用。

选项

  • false

  • true

checksum

字符串

此 ISO 的 MD5 校验和值。如果设置,我们将按校验和而不是名称搜索。

cross_zones

布尔值

ISO 是否应在区域之间同步或删除。

与 *zone* 互斥。

选项

  • false ← (默认)

  • true

display_text

字符串

ISO 的显示文本。

如果未指定,则使用 *name*。

domain

字符串

ISO 相关的域。

is_dynamically_scalable

布尔值

注册安装了 XS/VMware 工具的 ISO 以支持 VM cpu/内存的动态缩放。仅在 *state* 为 present 时使用。

选项

  • false

  • true

布尔值

注册 ISO 为特色。仅在 *state* 为 present 时使用。

选项

  • false

  • true

is_public

布尔值

注册 ISO 为对所有用户公开可用。仅在 *state* 为 present 时使用。

选项

  • false

  • true

is_ready

布尔值

此标志用于搜索现有的 ISO。如果设置为 yes,它将仅列出可用于部署的 ISO,例如成功下载和安装的 ISO。建议将其设置为 no

选项

  • false ← (默认)

  • true

iso_filter

字符串

用于搜索 ISO 的过滤器的名称。

选项

  • "featured"

  • "self" ← (默认)

  • "selfexecutable"

  • "sharedexecutable"

  • "executable"

  • "community"

name

字符串 / 必需

ISO 的名称。

os_type

字符串

最能代表此 ISO 操作系统的 OS 名称。如果 iso 可引导,则需要传递此参数。如果 *state* 为 present,则必需。

poll_async

布尔值

轮询异步作业,直到作业完成。

选项

  • false

  • true ← (默认)

project

字符串

要注册 ISO 的项目的名称。

state

字符串

ISO 的状态。

选项

  • "present" ← (默认)

  • "absent"

tags

别名:tag

列表 / 元素=字典

标签列表。标签是具有键 *key* 和 *value* 的字典列表。

要删除所有标签,请设置一个空列表,例如 *tags: []*。

url

字符串

可以从中下载 ISO 的 URL。如果 *state* 为 present,则必需。

validate_certs

布尔值

ngine_io.cloudstack 2.4.0 中新增

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

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

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

选项

  • false

  • true ← (默认)

zone

字符串

您希望注册或删除 ISO 的区域的名称。

当 *cross_zones* 为 no 时必需

备注

注意

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

  • 此模块支持检查模式。

示例

- name: Register an ISO if ISO name does not already exist
  ngine_io.cloudstack.cs_iso:
    name: Debian 7 64-bit
    zone: zone01
    url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso
    os_type: Debian GNU/Linux 7(64-bit)

- name: Register an ISO with given name if ISO md5 checksum does not already exist
  ngine_io.cloudstack.cs_iso:
    name: Debian 7 64-bit
    zone: zone01
    url: http://mirror.switch.ch/ftp/mirror/debian-cd/current/amd64/iso-cd/debian-7.7.0-amd64-netinst.iso
    os_type: Debian GNU/Linux 7(64-bit)
    checksum: 0b31bccccb048d20b551f70830bb7ad0

- name: Remove an ISO by name
  ngine_io.cloudstack.cs_iso:
    name: Debian 7 64-bit
    zone: zone01
    state: absent

- name: Remove an ISO by checksum
  ngine_io.cloudstack.cs_iso:
    name: Debian 7 64-bit
    zone: zone01
    checksum: 0b31bccccb048d20b551f70830bb7ad0
    state: absent

返回值

公共返回值已在此处记录 此处,以下是此模块特有的字段

描述

account

字符串

ISO 相关的账户。

返回值: success

示例: "example account"

bootable

布尔值

如果 ISO 可引导,则为 True。

返回值: success

示例: true

checksum

字符串

ISO 的 MD5 校验和。

返回值: success

示例: "0b31bccccb048d20b551f70830bb7ad0"

created

字符串

注册日期。

返回值: success

示例: "2015-03-29T14:57:06+0200"

cross_zones

布尔值

如果 ISO 在所有区域都受管理,则为 true,否则为 false。

返回值: success

示例: false

display_text

字符串

要显示的 ISO 文本。

返回值: success

示例: "Debian 7.7 64-bit minimal 2015-03-19"

domain

字符串

ISO 相关的域。

返回值: success

示例: "example domain"

格式

字符串

ISO 的格式。

返回值: success

示例: "ISO"

ID

字符串

ISO 的 UUID。

返回值: success

示例: "a6f7a5fc-43f8-11e5-a151-feff819cdc9f"

布尔值

如果 ISO 已启用,则为 True。

返回值: success

示例: true

is_public

布尔值

如果 ISO 为公共的,则为 True。

返回值: success

示例: true

is_ready

布尔值

如果 ISO 已准备好部署,则为 True。

返回值: success

示例: true

name

字符串

ISO 的名称。

返回值: success

示例: "Debian 7 64-bit"

os_type

字符串

操作系统的类型。

返回值: success

示例: "CentOS 6.5 (64-bit)"

project

字符串

ISO 相关的项目。

返回值: success

示例: "example project"

状态

字符串

ISO 的状态。

返回值: success

示例: "Successfully Installed"

标签

字典

与 ISO 关联的资源标签列表。

返回值: success

示例: "[ { \"key\": \"foo\", \"value\": \"bar\" } ]"

zone

字符串

注册 ISO 的区域名称。

返回值: success

示例: "zuerich"

作者

  • René Moser (@resmo)