Create a Linode using a StackScript through the CLI

Hello,

With the release of the CLI I have been searching on a way to create a Linode and deploying the linux distribution by specifying a StackScript (after spending time to create those StackScript in the first place I'd rather reuse them than connect through SSH to do the deployment).

Now it must be something very easy to do but somehow I cannot figure out how to do the equivalent of deploying through a StackScript when going through the CLI.

Any pointers?

Thanks a whole lot in advance,

Jean-Marc

2 Replies

Hi Jean, working on the same problem.

I've scanned through the API docs, and the linode-cli source code. Using the API docs, I suspect this might take the form of:

  • linode.create to set up the new linode ( https://www.linode.com/api/linode/linode.create )

  • linode.disk.createfromstackscript which sets up a new disk using parameter stackscript ( https://www.linode.com/api/linode/linod … tackscript">https://www.linode.com/api/linode/linode.disk.createfromstackscript )

Specifically:
@theckman:

You would then do linode.disk.createfromstackscript() as well as linode.disk.create() to create your swap image. Then you'd want to create your configuration profile using linode.config.create().
(source: https://forum.linode.com/viewtopic.php?t=9816&p=56206 )

However, based on grepping the source, it seems linode-cli does not support the disk management APIs yet. Therefore, this might only be possible via mixing the CLI with direct API calls as per above; specifically, eg wget https://api.linode.com/?api_key=abc123& … tackscript">https://api.linode.com/?apikey=abc123&apiaction=linode.disk.createfromstackscript&[parameters…] at the bottom of your linode creation scripts.

Thank you very much. I was hoping to avoid going to the API directly but until then I'll do with it.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct