ansible.builtin.profitbricks (v2.9.27) — module

Create, destroy, start, stop, and reboot a ProfitBricks virtual machine.

| "added in version" 2.0 of ansible.builtin"

Authors: Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Create, destroy, update, start, stop, and reboot a ProfitBricks virtual machine. When the virtual machine is created it can optionally wait for it to be 'running' before returning. This module has a dependency on profitbricks >= 1.0.0


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

# Note: These examples do not set authentication details, see the AWS Guide for details.

# Provisioning example. This will create three servers and enumerate their names.

- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Removing Virtual machines

- profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Starting Virtual Machines.

- profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: running
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Stopping Virtual Machines

- profitbricks:
    datacenter: Tardis One
    instance_ids:
      - 'web001.stackpointcloud.com'
      - 'web002.stackpointcloud.com'
      - 'web003.stackpointcloud.com'
    wait_timeout: 500
    state: stopped

Inputs

    
bus:
    choices:
    - IDE
    - VIRTIO
    default: VIRTIO
    description:
    - The bus type for the volume.

lan:
    default: 1
    description:
    - The ID of the LAN you wish to add the servers to.

ram:
    default: 2048
    description:
    - The amount of memory to allocate to the virtual machine.

name:
    description:
    - The name of the virtual machine.
    required: true

wait:
    default: 'yes'
    description:
    - wait for the instance to be in state 'running' before returning
    type: bool

cores:
    default: 2
    description:
    - The number of CPU cores to allocate to the virtual machine.

count:
    default: 1
    description:
    - The number of virtual machines to create.

image:
    description:
    - The system image ID for creating the virtual machine, e.g. a3eae284-a2fe-11e4-b187-5f1f641608c8.
    required: true

state:
    choices:
    - running
    - stopped
    - absent
    - present
    default: present
    description:
    - create or terminate instances

location:
    choices:
    - us/las
    - de/fra
    - de/fkb
    default: us/las
    description:
    - The datacenter location. Use only if you want to create the Datacenter or else this
      value is ignored.

ssh_keys:
    description:
    - Public SSH keys allowing access to the virtual machine.
    version_added: '2.2'
    version_added_collection: ansible.builtin

cpu_family:
    choices:
    - AMD_OPTERON
    - INTEL_XEON
    default: AMD_OPTERON
    description:
    - The CPU family type to allocate to the virtual machine.
    version_added: '2.2'
    version_added_collection: ansible.builtin

datacenter:
    description:
    - The datacenter to provision this virtual machine.

volume_size:
    default: 10
    description:
    - The size in GB of the boot volume.

instance_ids:
    description:
    - list of instance ids, currently only used when state='absent' to remove instances.

wait_timeout:
    default: 600
    description:
    - how long before wait gives up, in seconds

auto_increment:
    default: 'yes'
    description:
    - Whether or not to increment a single number in the name for created virtual machines.
    type: bool

image_password:
    description:
    - Password set for the administrative user.
    version_added: '2.2'
    version_added_collection: ansible.builtin

assign_public_ip:
    default: 'no'
    description:
    - This will assign the machine to the public LAN. If no LAN exists with public Internet
      access it is created.
    type: bool

subscription_user:
    description:
    - The ProfitBricks username. Overrides the PB_SUBSCRIPTION_ID environment variable.

remove_boot_volume:
    default: 'yes'
    description:
    - remove the bootVolume of the virtual machine you're destroying.
    type: bool

subscription_password:
    description:
    - THe ProfitBricks password. Overrides the PB_PASSWORD environment variable.