Note
This plugin is part of the community.general collection.
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.linode.
The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| additional_disks string | List of dictionaries for creating additional disks that are added to the Linode configuration settings. Dictionary takes Size, Label, Type. Size is in MB. | |
| alert_bwin_enabled boolean |
| Set status of bandwidth in alerts. |
| alert_bwin_threshold string | Set threshold in MB of bandwidth in alerts. | |
| alert_bwout_enabled boolean |
| Set status of bandwidth out alerts. |
| alert_bwout_threshold string | Set threshold in MB of bandwidth out alerts. | |
| alert_bwquota_enabled boolean |
| Set status of bandwidth quota alerts as percentage of network transfer quota. |
| alert_bwquota_threshold string | Set threshold in MB of bandwidth quota alerts. | |
| alert_cpu_enabled boolean |
| Set status of receiving CPU usage alerts. |
| alert_cpu_threshold string | Set percentage threshold for receiving CPU usage alerts. Each CPU core adds 100% to total. | |
| alert_diskio_enabled boolean |
| Set status of receiving disk IO alerts. |
| alert_diskio_threshold string | Set threshold for average IO ops/sec over 2 hour period. | |
| api_key string | Linode API key | |
| backupweeklyday string | Integer value for what day of the week to store weekly backups. | |
| datacenter string | datacenter to create an instance in (Linode Datacenter) | |
| displaygroup string | Add the instance to a Display Group in Linode Manager. | |
| distribution string | distribution to use for the instance (Linode Distribution) | |
| kernel_id string | kernel to use for the instance (Linode Kernel) | |
| linode_id string | Unique ID of a linode server. This value is read-only in the sense that if you specify it on creation of a Linode it will not be used. The Linode API generates these IDs and we can those generated value here to reference a Linode more specifically. This is useful for idempotence. aliases: lid | |
| name string / required | Name to give the instance (alphanumeric, dashes, underscore). To keep sanity on the Linode Web Console, name is prepended with LinodeID-. | |
| password string | root password to apply to a new server (auto generated if missing) | |
| payment_term string |
1 | payment term to use for the instance (payment term in months) |
| plan string | plan to use for the instance (Linode plan) | |
| private_ip boolean |
| Add private IPv4 address when Linode is created. |
| ssh_pub_key string | SSH public key applied to root user | |
| state string |
| Indicate desired state of the resource |
| swap string | Default: 512 | swap size in MB |
| wait boolean |
| wait for the instance to be in state running before returning |
| wait_timeout string | Default: 300 | how long before wait gives up, in seconds |
| watchdog boolean |
"True" | Set status of Lassie watchdog. |
Note
LINODE_API_KEY env variable can be used instead.- name: Create a new Linode
community.general.linode:
name: linode-test1
plan: 1
datacenter: 7
distribution: 129
state: present
register: linode_creation
- name: Create a server with a private IP Address
community.general.linode:
module: linode
api_key: 'longStringFromLinodeApi'
name: linode-test1
plan: 1
datacenter: 2
distribution: 99
password: 'superSecureRootPassword'
private_ip: yes
ssh_pub_key: 'ssh-rsa qwerty'
swap: 768
wait: yes
wait_timeout: 600
state: present
delegate_to: localhost
register: linode_creation
- name: Fully configure new server
community.general.linode:
api_key: 'longStringFromLinodeApi'
name: linode-test1
plan: 4
datacenter: 2
distribution: 99
kernel_id: 138
password: 'superSecureRootPassword'
private_ip: yes
ssh_pub_key: 'ssh-rsa qwerty'
swap: 768
wait: yes
wait_timeout: 600
state: present
alert_bwquota_enabled: True
alert_bwquota_threshold: 80
alert_bwin_enabled: True
alert_bwin_threshold: 10
alert_cpu_enabled: True
alert_cpu_threshold: 210
alert_bwout_enabled: True
alert_bwout_threshold: 10
alert_diskio_enabled: True
alert_diskio_threshold: 10000
backupweeklyday: 1
backupwindow: 2
displaygroup: 'test'
additional_disks:
- {Label: 'disk1', Size: 2500, Type: 'raw'}
- {Label: 'newdisk', Size: 2000}
watchdog: True
delegate_to: localhost
register: linode_creation
- name: Ensure a running server (create if missing)
community.general.linode:
api_key: 'longStringFromLinodeApi'
name: linode-test1
plan: 1
datacenter: 2
distribution: 99
password: 'superSecureRootPassword'
ssh_pub_key: 'ssh-rsa qwerty'
swap: 768
wait: yes
wait_timeout: 600
state: present
delegate_to: localhost
register: linode_creation
- name: Delete a server
community.general.linode:
api_key: 'longStringFromLinodeApi'
name: linode-test1
linode_id: "{{ linode_creation.instance.id }}"
state: absent
delegate_to: localhost
- name: Stop a server
community.general.linode:
api_key: 'longStringFromLinodeApi'
name: linode-test1
linode_id: "{{ linode_creation.instance.id }}"
state: stopped
delegate_to: localhost
- name: Reboot a server
community.general.linode:
api_key: 'longStringFromLinodeApi'
name: linode-test1
linode_id: "{{ linode_creation.instance.id }}"
state: restarted
delegate_to: localhost
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/general/linode_module.html