W3cubDocs

/Ansible

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

New in version 2.0.

Synopsis

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 (on host that executes module)

  • profitbricks
  • python >= 2.6

Options

parameter required default choices comments
assign_public_ip
no
This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created.
auto_increment
no True
  • yes
  • no
Whether or not to increment a single number in the name for created virtual machines.
bus
no VIRTIO
  • IDE
  • VIRTIO
The bus type for the volume.
cores
no 2
The number of CPU cores to allocate to the virtual machine.
count
no 1
The number of virtual machines to create.
cpu_family
(added in 2.2)
no AMD_OPTERON
  • AMD_OPTERON
  • INTEL_XEON
The CPU family type to allocate to the virtual machine.
datacenter
no
The datacenter to provision this virtual machine.
image
yes
The system image ID for creating the virtual machine, e.g. a3eae284-a2fe-11e4-b187-5f1f641608c8.
image_password
(added in 2.2)
no
Password set for the administrative user.
instance_ids
no
list of instance ids, currently only used when state='absent' to remove instances.
lan
no 1
The ID of the LAN you wish to add the servers to.
location
no us/las
  • 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
yes
The name of the virtual machine.
ram
no 2048
The amount of memory to allocate to the virtual machine.
remove_boot_volume
no yes
  • yes
  • no
remove the bootVolume of the virtual machine you're destroying.
ssh_keys
(added in 2.2)
no
Public SSH keys allowing access to the virtual machine.
state
no present
  • running
  • stopped
  • absent
  • present
create or terminate instances
subscription_password
no
THe ProfitBricks password. Overrides the PB_PASSWORD environement variable.
subscription_user
no
The ProfitBricks username. Overrides the PB_SUBSCRIPTION_ID environement variable.
volume_size
no 10
The size in GB of the boot volume.
wait
no yes
  • yes
  • no
wait for the instance to be in state 'running' before returning
wait_timeout
no 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

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/profitbricks_module.html