ansible.builtin.linode (v2.3.0.0-1) — module

create / delete / stop / restart an instance in Linode Public Cloud

| "added in version" 1.3 of ansible.builtin"

Authors: Vincent Viallet (@zbal)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.0.0.post1

Description

creates / deletes a Linode Public Cloud instance and optionally waits for it to be 'running'.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a server with a private IP Address
- local_action:
     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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Fully configure new server
- local_action:
     module: linode
     api_key: 'longStringFromLinodeApi'
     name: linode-test1
     plan: 4
     datacenter: 2
     distribution: 99
     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_diskio_enabled: True
     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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Ensure a running server (create if missing)
- local_action:
     module: linode
     api_key: 'longStringFromLinodeApi'
     name: linode-test1
     linode_id: 12345678
     plan: 1
     datacenter: 2
     distribution: 99
     password: 'superSecureRootPassword'
     ssh_pub_key: 'ssh-rsa qwerty'
     swap: 768
     wait: yes
     wait_timeout: 600
     state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete a server
- local_action:
     module: linode
     api_key: 'longStringFromLinodeApi'
     name: linode-test1
     linode_id: 12345678
     state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Stop a server
- local_action:
     module: linode
     api_key: 'longStringFromLinodeApi'
     name: linode-test1
     linode_id: 12345678
     state: stopped
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Reboot a server
- local_action:
     module: linode
     api_key: 'longStringFromLinodeApi'
     name: linode-test1
     linode_id: 12345678
     state: restarted

Inputs

    
name:
    default: null
    description:
    - Name to give the instance (alphanumeric, dashes, underscore)
    - To keep sanity on the Linode Web Console, name is prepended with LinodeID_

plan:
    default: null
    description:
    - plan to use for the instance (Linode plan)

swap:
    default: 512
    description:
    - swap size in MB

wait:
    choices:
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - wait for the instance to be in state 'running' before returning

state:
    choices:
    - present
    - active
    - started
    - absent
    - deleted
    - stopped
    - restarted
    default: present
    description:
    - Indicate desired state of the resource

api_key:
    default: null
    description:
    - Linode API key

password:
    default: null
    description:
    - root password to apply to a new server (auto generated if missing)

watchdog:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of Lassie watchdog.
    version_added: '2.2'
    version_added_collection: ansible.builtin

linode_id:
    aliases:
    - lid
    default: null
    description:
    - Unique ID of a linode server

datacenter:
    default: null
    description:
    - datacenter to create an instance in (Linode Datacenter)

private_ip:
    choices:
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - Add private IPv4 address when Linode is created.
    version_added: '2.3'
    version_added_collection: ansible.builtin

ssh_pub_key:
    default: null
    description:
    - SSH public key applied to root user

displaygroup:
    default: null
    description:
    - Add the instance to a Display Group in Linode Manager
    version_added: '2.3'
    version_added_collection: ansible.builtin

distribution:
    default: null
    description:
    - distribution to use for the instance (Linode Distribution)

payment_term:
    choices:
    - 1
    - 12
    - 24
    default: 1
    description:
    - payment term to use for the instance (payment term in months)

wait_timeout:
    default: 300
    description:
    - how long before wait gives up, in seconds

backupweeklyday:
    default: null
    description:
    - Integer value for what day of the week to store weekly backups.
    version_added: '2.3'
    version_added_collection: ansible.builtin

additional_disks:
    default: null
    description: 'List of dictionaries for creating additional disks that are added to
      the Linode configuration settings. Dictionary takes Size, Label, Type. Size is in
      MB.

      '
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_cpu_enabled:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of receiving CPU usage alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwin_enabled:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of bandwidth in alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwout_enabled:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of bandwidth out alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_cpu_threshold:
    default: null
    description:
    - Set percentage threshold for receiving CPU usage alerts. Each CPU core adds 100%
      to total.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwin_threshold:
    default: null
    description:
    - Set threshold in MB of bandwidth in alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_diskio_enabled:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of receiving disk IO alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwout_threshold:
    default: null
    description:
    - Set threshold in MB of bandwidth out alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwquota_enabled:
    choices:
    - 'True'
    - 'False'
    default: 'True'
    description:
    - Set status of bandwidth quota alerts as percentage of network tranfer quota.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_diskio_threshold:
    default: null
    description:
    - Set threshold for average IO ops/sec over 2 hour period.
    version_added: '2.3'
    version_added_collection: ansible.builtin

alert_bwquota_threshold:
    default: null
    description:
    - Set threshold in MB of bandwidth quota alerts.
    version_added: '2.3'
    version_added_collection: ansible.builtin