displague / deprecated-terraform-provider-linode

[OLD] Terraform provider plugin for Linode Cloud resources.. See
https://github.com/terraform-providers/terraform-provider-linode
Mozilla Public License 2.0
15 stars 5 forks source link

implement linode_stackscript resource #9

Closed displague closed 6 years ago

displague commented 6 years ago

Allow management of StackScripts on an account using a syntax like:

resource "linode_stackscript" "mounterscript" {
   // Linode doesn't have a unique string identifier for Stackscripts,
   // so I'm thinking we fake it in TF using username+stackscript+title
   // matching their canonical URL on the website (without the numeric ID).
   title = "My Mounter Script" // canonicalized by TF as something like username/my-mounter-script 
   script = [ "#!/bin/bash", "grep ... || (echo ... >> /etc/fstab && mount ... )" ]
   public = false
}

resource "linode_instance" "boots_to_mounterscript" {
   ...
   disks = [ {
    image: "linode/ubuntu18.04",
    stackscript: "${linode_stackscript.mounterscript.id}",
    ... Linode disk API call requires root pw, ssh key, size, etc.
    .... This will also need a way to provide StackScript params.
  } ]
}
displague commented 6 years ago

Stackscripts have been implemented:

https://github.com/displague/terraform-provider-linode/blob/b69fa5a18cd5677e25bb2d3a33519fa1a40c4226/examples/main.tf#L188-L216