How do I run StackScript from Terraform?

I have looked at tutorials from both Terraform and Linode and still have an issue where the StackScript isn't being run after me terraforming the node

The stackscript I have has been provided either inline as both tutorials suggest or imported from linode as the last line suggested in Terraform tutorial

StackScript seem to be copied into root's home directory but is never executed.

1 Reply

Hi @mikhailveygman,

It's normal to see the executable StackScript in the /root directory after the Linode has been provisioned, unless your script ends with a cleanup command.

# Cleanup
rm /root/StackScript
echo "Installation complete!"

As long as the script is functional and Terraform gave you the green 'Apply complete!', you should be able to login and confirm it did everything you wanted it to do (e.g. create user accounts, initialize a Docker swarm, etc).

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