Global Variables
Global variables apply to every host in your inventory. Use these for values that are consistent across all your Pis — things like your API endpoint, authentication key, or any shared payload values.
In Semaphore, global variables are managed through the Environment feature.
Setting up an environment
- In Semaphore, navigate to Environment.
- Click New Environment.
- Give it a friendly name (e.g.
Rondo Global Config). - Make sure you’re adding values under Extra Variables — not Survey Variables.
- Add each variable as a key-value pair.
For example, to share an API URL and key across all hosts:
{
"api_url": "https://api.example.com",
"api_key": "your-api-key-here"
}Using secrets
For sensitive values like API keys, use Semaphore’s built-in Secrets manager rather than entering them as plain-text Extra Variables. Secrets are encrypted at rest and masked in job output logs.
To use a secret as a variable:
- Navigate to Secrets and create a new secret with your value.
- Reference it in your Environment configuration by name.
Environment vs inventory precedence
If the same variable is defined in both an Environment and a host’s inventory entry, the inventory value takes precedence for that host. This means you can set a sensible global default in the Environment and override it per host in the inventory when needed.