Skip to content

Latest commit

 

History

History
117 lines (101 loc) · 5.08 KB

image.md

File metadata and controls

117 lines (101 loc) · 5.08 KB

image

Manage a Linode Image.

Minimum Required Fields

Field Type Required Description
api_token str Required The Linode account personal access token. It is necessary to run the module.
It can be exposed by the environment variable LINODE_API_TOKEN instead.
See details in Usage.

Examples

- name: Create a basic image from an existing disk
  linode.cloud.image:
    label: my-image
    description: Created using Ansible!
    disk_id: 12345
    tags: 
        - test
    state: present
- name: Create a basic image from a file
  linode.cloud.image:
    label: my-image
    description: Created using Ansible!
    source_file: myimage.img.gz
    tags: 
        - test
    state: present
- name: Replicate an image
  linode.cloud.image:
    label: my-image
    description: Created using Ansible!
    disk_id: 12345
    tags: 
        - test
    replica_regions: 
        - us-east
        - us-central
    state: present
- name: Delete an image
  linode.cloud.image:
    label: my-image
    state: absent

Parameters

Field Type Required Description
label str Required This Image's unique label.
state str Required The state of this Image. (Choices: present, absent)
cloud_init bool Optional Whether this image supports cloud-init. (Default: False)
description str Optional A description for the Image. (Updatable)
disk_id int Optional The ID of the disk to clone this image from. (Conflicts With: source_file)
recreate bool Optional If true, the image with the given label will be deleted and recreated (Default: False)
region str Optional The Linode region to upload this image to. (Default: us-east)
source_file str Optional An image file to create this image with. (Conflicts With: disk_id)
wait bool Optional Wait for the image to have status available before returning. (Default: True)
wait_timeout int Optional The amount of time, in seconds, to wait for an image to have status available. (Default: 600)
tags list Optional A list of customized tags of this new Image. (Updatable)
replica_regions list Optional A list of regions that customer wants to replicate this image in. At least one available region must be provided and only core regions allowed. Existing images in the regions not passed will be removed. NOTE: Image replication may not currently be available to all users. (Updatable)
wait_for_replications bool Optional Wait for the all the replications available before returning. (Default: False)

Return Values

  • image - The Image in JSON serialized form.

    • Sample Response:
      {
        "capabilities": [],
        "created": "2021-08-14T22:44:02",
        "created_by": "my-account",
        "deprecated": false,
        "description": "Example Image description.",
        "eol": "2026-07-01T04:00:00",
        "expiry": null,
        "id": "private/123",
        "is_public": true,
        "label": "my-image",
        "size": 2500,
        "status": null,
        "type": "manual",
        "updated": "2021-08-14T22:44:02",
        "vendor": "Debian",
        "tags": ["test"],
        "total_size": 5000,
        "regions": [
          {
              "region": "us-east",
              "status": "available"
          },
          {
              "region": "us-central",
              "status": "pending"
          }
        ]
      }
    • See the Linode API response documentation for a list of returned fields