community.general.profitbricks module – Create, destroy, start, stop, and reboot a ProfitBricks virtual machine
Note
This module is part of the community.general collection (version 9.5.1).
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
.
You need further requirements to be able to use this module,
see Requirements for details.
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
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: |
|
The number of virtual machines to create. Default: |
|
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. Default: |
|
The ID of the LAN you wish to add the servers to. Default: |
|
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: |
|
remove the bootVolume of the virtual machine you’re destroying. Choices:
|
|
Public SSH keys allowing access to the virtual machine. Default: |
|
create or terminate instances The choices available are: Default: |
|
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: |
|
wait for the instance to be in state ‘running’ before returning Choices:
|
|
how long before wait gives up, in seconds Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: none |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
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