New in version 2.8.
The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
access_token
-
/ required
|
The Linode API v4 access token. It may also be specified by exposing the
LINODE_ACCESS_TOKEN environment variable. See https://developers.linode.com/api/v4#section/Access-and-Authentication. |
|
authorized_keys
list
|
A list of SSH public key parts to deploy for the root user.
|
|
group
string
|
The group that the instance should be marked under. Please note, that group labelling is deprecated but still supported. The encouraged method for marking instances is to use tags.
|
|
image
string
|
The image of the instance. This is a required parameter only when creating Linode instances. See https://developers.linode.com/api/v4#tag/Images.
|
|
label
string
/ required
|
The instance label. This label is used as the main determiner for idempotence for the module and is therefore mandatory.
|
|
region
string
|
The region of the instance. This is a required parameter only when creating Linode instances. See https://developers.linode.com/api/v4#tag/Regions.
|
|
root_pass
string
|
The password for the root user. If not specified, one will be generated. This generated password will be available in the task success JSON.
|
|
state
string
/ required
|
|
The desired instance state.
|
tags
list
|
The tags that the instance should be marked under. See https://developers.linode.com/api/v4#tag/Tags.
|
|
type
string
|
The type of the instance. This is a required parameter only when creating Linode instances. See https://developers.linode.com/api/v4#tag/Linode-Types.
|
Note
- name: Create a new Linode.
linode_v4:
label: new-linode
type: g6-nanode-1
region: eu-west
image: linode/debian9
root_pass: passw0rd
authorized_keys:
- "ssh-rsa ..."
state: present
- name: Delete that new Linode.
linode_v4:
label: new-linode
state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
instance
dictionary
|
Always. |
The instance description in JSON serialized form.
Sample:
{'status': 'running', 'root_pass': 'foobar', 'updated': '2018-09-26T10:10:14', 'watchdog_enabled': True, 'image': 'linode/centos7', 'id': 10480444, 'backups': {'enabled': False, 'schedule': {'window': None, 'day': None}}, 'specs': {'transfer': 1000, 'vcpus': 1, 'disk': 25600, 'memory': 1024}, 'tags': [], 'group': 'Foobar Group', 'created': '2018-09-26T08:12:33', 'hypervisor': 'kvm', 'region': 'eu-west', 'alerts': {'transfer_quota': 80, 'network_out': 10, 'network_in': 10, 'io': 10000, 'cpu': 90}, 'label': 'lin-foo', 'ipv4': ['130.132.285.233'], 'ipv6': '2a82:7e00::h03c:46ff:fe04:5cd2/64', 'type': 'g6-nanode-1'}
|
Hint
If you notice any issues in this documentation you can edit this document to improve it.