How to run scripts on edge nodes
Install Azion CLI on Orchestrator edge nodes with a Shell Script resource, using Azion Console or API v3.
To be able to orchestrate services on your device, you must configure all the resources needed to install, uninstall, and reload your services.
This guide presents how to install Azion CLI on your edge nodes through a resource of the type Shell Script configured on a specific edge service.
Requirements
Console
- An edge node with Orchestrator Agent installed and authorized.
- The Dpkg package manager installed on this node.
Creating an edge service
Console
- Access Azion Console > Edge Services.
- Select + Service.
- Name this service
Azion CLI Installation. - Enter the variables and values for the resource, if necessary.
- Set the status as Active.
- Select Save.
Creating a resource
Console
- Inside the service you’ve just created, called
Azion CLI Installation, go to the Resources tab. - Click on + Resource.
- Enter
/scripts/install-cliin the Path field. - Choose the type Shell Script.
- Choose the trigger Install.
- Add the following content to the Content block:
Shell
- Click the Save button.
This script will install the Azion binary in the following path: /usr/local/bin
Binding an edge service to an edge node
Console
- Go to Edge Nodes.
- Select the edge node to which you want to bind a service.
- Go to the Services tab and click the + Service button.
- Choose the service
Azion CLI Installationyou’ve created. - Click the Save button.
Accessing Azion CLI
After this process, in your edge node, access the folder:
Run:
The output will be similar to:
Text