community.general.profitbricks 模块 – 创建、销毁、启动、停止和重启 ProfitBricks 虚拟机
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install community.general。您需要其他要求才能使用此模块,有关详细信息,请参见 要求。
要在 playbook 中使用它,请指定: community.general.profitbricks。
摘要
- 创建、销毁、更新、启动、停止和重启 ProfitBricks 虚拟机。创建虚拟机时,可以选择等待其运行后再返回。此模块依赖于 profitbricks >= 1.0.0 
要求
以下要求是在执行此模块的主机上所需的。
- profitbricks 
参数
| 参数 | 注释 | 
|---|---|
| 这会将机器分配到公共 LAN。如果没有具有公共互联网访问权限的 LAN,则会创建一个。 选项 
 | |
| 是否为创建的虚拟机名称中的单个数字递增。 选项 
 | |
| 卷的总线类型。 选项 
 | |
| 分配给虚拟机的 CPU 核心数。 默认值:  | |
| 要创建的虚拟机数量。 默认值:  | |
| 分配给虚拟机的 CPU 系列类型。 选项 
 | |
| 为此虚拟机配置的数据中心。 | |
| 要分配的磁盘类型。 选项 
 | |
| 用于创建虚拟机的系统映像 ID,例如 a3eae284-a2fe-11e4-b187-5f1f641608c8。 | |
| 为管理员用户设置的密码。 | |
| 实例 ID 列表,目前仅在 state='absent' 时用于删除实例。 默认值:  | |
| 要将服务器添加到其中的 LAN 的 ID。 默认值:  | |
| 数据中心位置。仅当您要创建数据中心时才使用,否则此值将被忽略。 选项 
 | |
| 虚拟机的名称。 | |
| 分配给虚拟机的内存量。 默认值:  | |
| 删除要销毁的虚拟机的 bootVolume。 选项 
 | |
| 允许访问虚拟机的公共 SSH 密钥。 默认值:  | |
| 创建或终止实例 可用的选项是: 默认值:  | |
| ProfitBricks 密码。覆盖 PB_PASSWORD 环境变量。 | |
| ProfitBricks 用户名。覆盖 PB_SUBSCRIPTION_ID 环境变量。 | |
| 引导卷的大小(以 GB 为单位)。 默认值:  | |
| 等待实例处于“运行”状态后再返回 选项 
 | |
| 等待超时时间(秒) 默认值:  | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:不支持 | 可以在  | |
| 支持:不支持 | 在 diff 模式下,将返回关于哪些内容已更改(或在  | 
示例
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Provisioning example
- name: Create three servers and enumerate their names
  community.general.profitbricks:
    datacenter: Tardis One
    name: web%02d.stackpointcloud.com
    cores: 4
    ram: 2048
    volume_size: 50
    cpu_family: INTEL_XEON
    image: a3eae284-a2fe-11e4-b187-5f1f641608c8
    location: us/las
    count: 3
    assign_public_ip: true
- name: Remove virtual machines
  community.general.profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: absent
- name: Start virtual machines
  community.general.profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: running
- name: Stop virtual machines
  community.general.profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: stopped
