Creating and Retrieving New StackScript

When you set up your Akamai Linode Cloud profile on ScaleGrid, you’ll need to set up a new stackscript and link it to your profile.

Step 1: Create New StackScript

In the side bar on your Akamai Linode console, find the StackScript section.

Then click on the button Create StackScript in the top right corner.

You will now see the following page:

We are now going to fill out these fields as follows:

  • StackScript Label: Can be anything of your choosing
  • Description: Can be anything of your choosing
  • Target Images: Select Centos7
  • Script: Enter the following content:
#!/bin/bash	
# <UDF name="SCRIPT_URL" Label="Fetch this script and execute it"/>
exec > /var/log/sg-stackscript.log
exec 2>&1	
set -x
yumcount=1
while [ $yumcount -le 20 ]
do
    echo "*** stackscript - yum install try $yumcount ***"
    command -v wget >/dev/null 2>&1 || yum install -y wget
    if [ $? -eq 0 ]; then
        break
    fi
    yumcount=$(( $yumcount + 1 ))
    sleep 2
done
command -v dos2unix >/dev/null 2>&1 || yum install -y dos2unix || exit 1
cd ${HOME}
SCRIPT=$(basename $SCRIPT_URL)
rm -f ${SCRIPT}
echo "Copying ${SCRIPT_URL} to ${HOME}"
wget --tries=5 ${SCRIPT_URL} && /usr/bin/dos2unix ${SCRIPT} && . ${SCRIPT}
cd ${HOME} && rm -f ${SCRIPT}

Once you have done this, click the Create StackScript button at the bottom of the page.

Step 2: Getting the StackScript ID

Go back to the StackScripts page in the Linode console and find the script you just created. After clicking on it, you can find the StackScript ID near the top of the page:

Copy this ID, you will need this ID to complete your Akamai Linode cloud profile setup with ScaleGrid.