Variable Groups
Variable Groups in CloudRay provide a convenient way to define and manage sets of variables for use in your script templates. They help you centralise configuration, customise script behaviour, and enhance security by storing sensitive data securely.
The key benefits of Variable Groups include:
- Customise Script Behaviour: Inject different values into your scripts based on the environment, purpose, or target server
- Centralise Configuration: Store and manage common variables in a single location, simplifying updates and maintenance
- Enhance Security: Avoid hardcoding sensitive information like passwords or API keys directly in your scripts
Creating Variable Group
Follow these steps to create a new variable group in CloudRay:
- Navigate to “Variable Groups”: Click on the “Variable Groups” tab in the CloudRay interface.

- Click “New Script Variable Group”: Start creating a new variable group.

- Enter Details:

- Name: Provide a descriptive name for your group (e.g., “Production Environment Variables”, “Website Deployment Settings”).
- Variables:
- Key: Enter the name of the variable (e.g.,
api_key
,db_password
). - Value: Enter the corresponding value for the variable.
- Add More Variables: Click the ”+” button to add additional key-value pairs to your group.
- Key: Enter the name of the variable (e.g.,
- Save Variable Group: Click “Save Variable Group” to store your newly created group.
Managing Variable Groups
You can view, update, and delete variable groups to ensure your automation scripts stay aligned with the latest configurations.
Viewing Existing Variable Groups

To check your available Variable Groups, simply click on the “Variable Groups” in the list. This will display the list of variable groups available in your account
Editing a Variable Group
If you need to modify your variable group’s details, follow these steps:

- Click “Edit” next to the variable you wish to update

- Modify the variable name, add or remove variables, or update their values
- Click on “Save” to save your changes
Deleting a Variable Group
- Find the group you want to remove

- Click “Delete” to delete the variable group
Using Variable Groups in Scripts
CloudRay allows you to dynamically reference variables from your groups within script templates.
- Create a Runlog: When you create a new Runlog to execute a script, you’ll have the option to select a Variable Group.
- Reference Variables in Your Script: In your script template, use the following syntax to reference variables from the selected group:
For example, if you have a variable named api_key
in your group, you would reference it in your script template like this:
API_KEY={{api_key}}
This approach keeps your scripts flexible and environment-agnostic while enhancing security and maintainability.
For more details on managing and running scripts in CloudRay, refer to the Script and Runlogs docs.