community.general.profitbricks – Create, destroy, start, stop, and reboot a ProfitBricks virtual machine.
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.profitbricks
.
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
The below requirements are needed on the host that executes this module.
profitbricks
python >= 2.6
Parameters
Parameter |
Comments |
---|---|
This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created. Choices:
|
|
Whether or not to increment a single number in the name for created virtual machines. Choices:
|
|
The bus type for the volume. Choices:
|
|
The number of CPU cores to allocate to the virtual machine. Default: 2 |
|
The number of virtual machines to create. Default: 1 |
|
The CPU family type to allocate to the virtual machine. Choices:
|
|
The datacenter to provision this virtual machine. |
|
the type of disk to be allocated. Choices:
|
|
The system image ID for creating the virtual machine, e.g. a3eae284-a2fe-11e4-b187-5f1f641608c8. |
|
Password set for the administrative user. |
|
list of instance ids, currently only used when state=’absent’ to remove instances. |
|
The ID of the LAN you wish to add the servers to. Default: 1 |
|
The datacenter location. Use only if you want to create the Datacenter or else this value is ignored. Choices:
|
|
The name of the virtual machine. |
|
The amount of memory to allocate to the virtual machine. Default: 2048 |
|
remove the bootVolume of the virtual machine you’re destroying. Choices:
|
|
Public SSH keys allowing access to the virtual machine. |
|
create or terminate instances The choices available are: Default: “present” |
|
THe ProfitBricks password. Overrides the PB_PASSWORD environment variable. |
|
The ProfitBricks username. Overrides the PB_SUBSCRIPTION_ID environment variable. |
|
The size in GB of the boot volume. Default: 10 |
|
wait for the instance to be in state ‘running’ before returning Choices:
|
|
how long before wait gives up, in seconds Default: 600 |
Examples
# 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
Authors
Matt Baldwin (@baldwinSPC) <baldwin@stackpointcloud.com>