Skip to main content
Script step allows you to perform your own work on the nodes: application diagnostics, deployment, environment preparation or maintenance. Telepúrte saves the script in the catalog, fixes it in the playbook version and shows the result separately for each node.

Formats and environment

| Format | How to execute | What is required on the | node |---|---|---| | .sh | Bash script | /bin/bash and used commands | | .yml, .yaml | Ansible playbook with local connection to localhost | ansible-playbook, necessary collections and dependencies | Ansible runs locally on each selected node. The list of servers is set in Telepúrte; do not transfer an external SSH inventory to such a file for a separate Ansible control server. The script works in the context of the agent and its system constraints. Check the process user and available rights: the choice of script in the panel does not automatically give root or sudo. The imported node requires a compatible version of Axottle Agent with support for scripts.

Add material

In Playbooks and Schedules add the script to the directory: upload the file or paste the text. The name should use Latin, numbers, dot, hyphen or underline and a suitable extension. Script - UTF-8 without zero characters. Then create or open a new version of the playbook, add the action Run the script and select it. If necessary, attach regular files and a set of environments. One directory file is limited to 1 MiB. Input files at a step can be up to eight; the total volume of the script and its input files is limited to 2 MiB. The names of the input files must be unique within the launch.

Bash example without changing the server

Save as inspect.sh:
Add a regular app.conf file and a set of variables with DEPLOY_ENV=test. Attach them to a step and execute them on one node. The script prints the environment tag, uptime and checksum of the transferred file. It does not install app.conf in /etc: such placement should be explicitly written in the script or made a typed action. The input files are located in the directory that TELEPURTE_FILES_DIR sets the path to. The work directory is temporary; do not rely on files from the previous execution. After completion, temporary materials are deleted.

Example of Ansible

Save inspect.yml:
ansible-playbook must be installed on each selected machine. If not, the result will be ansible_unavailable; Telepúrte does not install Ansible automatically during this step. Collections, utilities and rights for the more complex playbook also prepare in advance.

Environment variables

Create a named set and add name/value pairs. Names must be unique; up to 64 variables and up to 32 KiB of the set are supported; System names affecting the launch of the interpreter and the LD_ prefix are prohibited. Do not replace PATH, BASH_ENV or TELEPURTE_FILES_DIR. Values are transmitted directly to the process environment; .env is not created on the server. If the application is waiting for a file, add it separately or explicitly create it in a script with the right permissions. Materials are stored encrypted. In the output, it hides the matching values of the environment, but this is not protection against all ways of inferring a secret: the converted, broken or encrypted value may not match. Do not turn on set -x and do not print the entire environment in secret scenarios.

Time and result

Script execution is limited to 15 minutes. The result includes the completion code, the error code, and a limited combined stdout/stderr. The saved output can be clipped; the interface shows the corresponding feature; Keep a long full log where your application intended it, and don’t count the short Telepúrte result as a full deployment log. A normal run from the interface does not include an automatic canary. Choose the test node first; a phased rollout with an error threshold is described in the tasks.

Verification

Check the completion code and output on the test node, then the expected result with an independent command or application query. For modifying scripts, allow for re-run without damaging the already prepared state.

Rollback

Stop the unissued activity in the task. This does not cancel the script that has already been executed. Return configurations, versions and data with a separate script; before repeating after a timeout, first check what has already changed. Automation capabilities depend on the agent’s version and local policies.