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

New in version 2.0.

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • profitbricks
  • python >= 2.6

Parameters

Parameter Choices/Defaults Comments
assign_public_ip
bool
    Choices:
  • no ←
  • yes
This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created.
auto_increment
bool
    Choices:
  • no
  • yes ←
Whether or not to increment a single number in the name for created virtual machines.
bus
    Choices:
  • IDE
  • VIRTIO ←
The bus type for the volume.
cores Default:
2
The number of CPU cores to allocate to the virtual machine.
count Default:
1
The number of virtual machines to create.
cpu_family
(added in 2.2)
    Choices:
  • AMD_OPTERON ←
  • INTEL_XEON
The CPU family type to allocate to the virtual machine.
datacenter
The datacenter to provision this virtual machine.
image
required
The system image ID for creating the virtual machine, e.g. a3eae284-a2fe-11e4-b187-5f1f641608c8.
image_password
(added in 2.2)
Password set for the administrative user.
instance_ids
list of instance ids, currently only used when state='absent' to remove instances.
lan Default:
1
The ID of the LAN you wish to add the servers to.
location
    Choices:
  • us/las ←
  • de/fra
  • de/fkb
The datacenter location. Use only if you want to create the Datacenter or else this value is ignored.
name
required
The name of the virtual machine.
ram Default:
2048
The amount of memory to allocate to the virtual machine.
remove_boot_volume
bool
    Choices:
  • no
  • yes ←
remove the bootVolume of the virtual machine you're destroying.
ssh_keys
(added in 2.2)
Public SSH keys allowing access to the virtual machine.
state
    Choices:
  • running
  • stopped
  • absent
  • present ←
create or terminate instances
subscription_password
THe ProfitBricks password. Overrides the PB_PASSWORD environment variable.
subscription_user
The ProfitBricks username. Overrides the PB_SUBSCRIPTION_ID environment variable.
volume_size Default:
10
The size in GB of the boot volume.
wait
bool
    Choices:
  • no
  • yes ←
wait for the instance to be in state 'running' before returning
wait_timeout Default:
600
how long before wait gives up, in seconds

Examples

# 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

# Removing Virtual machines

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

# Starting Virtual Machines.

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

# Stopping Virtual Machines

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

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

Hint

If you notice any issues in this documentation you can edit this document to improve it.