Search code examples
global-variablesrundeck

How to resolve global variables in Rundeck?


I tried adding my variable in:

{Rundeck-Path}/etc/project.properties

as

project.globals.test=myvalue

And trying to access it from an inline script as

echo @globals.test@ 

however it does not print the value, instead I get an empty string, any idea what am I doing wrong here?


Solution

  • The project.properties config isn't a "real file" anymore (on Rundeck 2.X and 3.0.X it does), that information is stored on the internal Rundeck Database.

    To add globals on the project.properties follow these steps:

    1. Go to your project.
    2. Click on the "Project Settings" > "Edit Configuration" (left panel).
    3. Then click on the "Edit Configuration File" button (up to right).
    4. Add your project global variable like in the config: project.globals.myglobal=hello in a new line and Save.
    5. Now if you print the @globals.myglobal@ in any inline-script step, you can see the global content.