ngine_io.cloudstack.cs_router 模块 – 管理基于 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_router
。
ngine_io.cloudstack 0.1.0 中的新增功能
概要
启动、重启、停止和销毁路由器。
state=present 无法创建路由器,请改用 ngine_io.cloudstack.cs_network。
需求
执行此模块的主机需要以下需求。
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。 |
|
路由器的状态。 选项
|
|
如果 如果未给出,则考虑 这仅应在使用自签名证书的个人控制站点上使用。 选项
|
|
路由器部署所在的区域的名称。 如果未设置,则使用所有区域。 |
备注
注意
有关 cloudstack 模块的详细指南,请参阅 CloudStack 云指南。
此模块支持检查模式。
示例
# Ensure the router has the desired service offering, no matter if
# the router is running or not.
- name: Present router
ngine_io.cloudstack.cs_router:
name: r-40-VM
service_offering: System Offering for Software Router
- name: Ensure started
ngine_io.cloudstack.cs_router:
name: r-40-VM
state: started
# Ensure started with desired service offering.
# If the service offerings changes, router will be rebooted.
- name: Ensure started with desired service offering
ngine_io.cloudstack.cs_router:
name: r-40-VM
service_offering: System Offering for Software Router
state: started
- name: Ensure stopped
ngine_io.cloudstack.cs_router:
name: r-40-VM
state: stopped
- name: Remove a router
ngine_io.cloudstack.cs_router:
name: r-40-VM
state: absent
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
路由器相关的账户。 返回: success 示例: |
|
路由器创建的日期。 返回: success 示例: |
|
路由器相关的域。 返回: success 示例: |
|
路由器的 UUID。 返回: success 示例: |
|
路由器的名称。 返回: success 示例: |
|
路由器的冗余状态。 返回: success 示例: |
|
路由器是否需要升级到新的模板。 返回: success 示例: |
|
路由器的角色。 返回: success 示例: |
|
路由器所拥有的服务提供的名称。 返回: success 示例: |
|
路由器的状态。 返回: success 示例: |
|
系统VM模板的版本。 返回: success 示例: |
|
路由器所在的区域名称。 返回: success 示例: |