Skip to content

Latest commit

 

History

History
88 lines (74 loc) · 3.92 KB

stackscript.md

File metadata and controls

88 lines (74 loc) · 3.92 KB

stackscript

Manage a Linode StackScript.

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 StackScript
  linode.cloud.stackscript:
    label: my-stackscript
    images: ['linode/ubuntu22.04']
    description: Install a system package
    script: |
        #!/bin/bash
        # <UDF name="package" label="System Package to Install" example="nginx" default="">
        apt-get -q update && apt-get -q -y install $PACKAGE
    state: present
- name: Delete a StackScript
  linode.cloud.stackscript:
    label: my-stackscript
    state: absent

Parameters

Field Type Required Description
label str Required This StackScript's unique label.
state str Required The state of this StackScript. (Choices: present, absent)
description str Optional A description for the StackScript. (Updatable)
images list Optional Images that can be deployed using this StackScript. (Updatable)
is_public bool Optional This determines whether other users can use your StackScript. (Updatable)
rev_note str Optional This field allows you to add notes for the set of revisions made to this StackScript. (Updatable)
script str Optional The script to execute when provisioning a new Linode with this StackScript. (Updatable)

Return Values

  • stackscript - The StackScript in JSON serialized form.

    • Sample Response:
      {
        "created": "2018-01-01T00:01:01",
        "deployments_active": 1,
        "deployments_total": 12,
        "description": "This StackScript installs and configures MySQL",
        "id": 10079,
        "images": [
          "linode/debian11",
          "linode/debian10"
        ],
        "is_public": true,
        "label": "a-stackscript",
        "mine": true,
        "rev_note": "Set up MySQL",
        "script": "#!/bin/bash",
        "updated": "2018-01-01T00:01:01",
        "user_defined_fields": [
          {
            "default": null,
            "example": "hunter2",
            "label": "Enter the password",
            "manyOf": "avalue,anothervalue,thirdvalue",
            "name": "DB_PASSWORD",
            "oneOf": "avalue,anothervalue,thirdvalue"
          }
        ],
        "user_gravatar_id": "a445b305abda30ebc766bc7fda037c37",
        "username": "myuser"
      }
    • See the Linode API response documentation for a list of returned fields