Script Definition Configuration

The script definition configuration file is a JSON file that provides the details needed to add one or more script definitions to Edge builder.

Script definition configuration files have the following format:

Python Script Definition Config:

{
  "ScriptDefinitionConfig": [
    {
        "Name": "Hello",
        "Description": "Example script definition to print Hello World",
        "ScriptFile": "/vagrant/examples/hello.py",
        "Labels": ["scriptDef_label1", "scriptDef_label2"]
    }
 ]
}

Info

The ScriptFile type defines the type of script we are adding to EdgeBuilder: .sh defines a shell script .py defines a python script

The content of the file is described in the following table:

Parameter Type Required (Y/N) Description
Name String Y The name of the script definition
Description String N A description of the script definition
ScriptFile String Y The path to the script file, which defines the script
Labels String Array N A list of labels with which to associate the script definition

Info

To deploy the script, the script file must end with the following lines:
Python

print("changed=yes")
exit(0)
Shell
echo "changed=yes"
exit 0
You can also set changed for a fail case:
echo "changed=no"
exit 1