Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

how to use a "Node Step" to set a variable?

24 views
Skip to first unread message

aristos....@gmail.com

unread,
Feb 17, 2025, 8:22:23 AMFeb 17
to rundeck-discuss
I have a Rundeck job for which the strategy is "Node First". This is because all steps must run on the node, before proceeding to the next node.

The problem is that one of the three steps is a "Global Variable", which is a "Workflow Step".  This causes the job to ignore the "Node First" strategy, because all the steps must be "Node Steps" for the "Node First" strategy to be applied.

1.png

How can I use a "Node Step" to set a variable, that can be used on the next step?

rac...@rundeck.com

unread,
Feb 17, 2025, 9:46:33 AMFeb 17
to rundeck-discuss

Hi,

Why don’t you use the data value directly in the next step? Can you share a basic job example to take a look at?

If you need to do something outside data variables directly. You can use the data node step with the data gathered in the previous step, like this:

- defaultTab: nodes description: '' executionEnabled: true id: 825a2977-e82b-4e8f-b587-e5296abf219e loglevel: INFO name: HelloWorld nodeFilterEditable: false nodefilters: dispatch: excludePrecedence: true keepgoing: false rankOrder: ascending successOnEmptyNodeFilter: false threadcount: '1' filter: node.* nodesSelectedByDefault: true plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - exec: whoami plugins: LogFilter: - config: invalidKeyPattern: \s|\$|\{|\}|\\ logData: 'true' name: mydata regex: (.*) replaceFilteredResult: 'false' type: key-value-data - exec: echo "the data is ${data.mydata}" - configuration: data: mycustomdata=${data.mydata} format: properties nodeStep: true type: stub-node-step - exec: echo ${stub.mycustomdata} keepgoing: false strategy: node-first uuid: 825a2977-e82b-4e8f-b587-e5296abf219e

In this way, you can use it in the node context.

Regards!

Reply all
Reply to author
Forward
0 new messages