Usage of "nodename" as variable in bash script

12 views
Skip to first unread message

Bartosz Kowalewski

unread,
Sep 16, 2024, 3:59:29 AMSep 16
to rundeck...@googlegroups.com
Hello.
Is there a way to use nodename variable in bash script on particular host?
Thanks
Bart

rac...@rundeck.com

unread,
Sep 23, 2024, 8:08:38 AMSep 23
to rundeck-discuss

Hello,

Yes, first check this. For inline scripts use @node.name@ format, and for “external” scripts you can use the $RD_NODE_NAME format.

Check the following job definition example:

- defaultTab: nodes description: '' executionEnabled: true id: 5452edfc-eed3-466a-8934-2ae748635543 loglevel: INFO name: NodeName nodeFilterEditable: false nodefilters: dispatch: excludePrecedence: true keepgoing: false rankOrder: ascending successOnEmptyNodeFilter: false threadcount: '1' filter: .* nodesSelectedByDefault: true plugins: ExecutionLifecycle: {} scheduleEnabled: true sequence: commands: - autoSecureInput: 'false' fileExtension: .sh interpreterArgsQuoted: false passSecureInput: 'false' script: echo @node.name@ scriptInterpreter: /bin/bash keepgoing: false strategy: node-first uuid: 5452edfc-eed3-466a-8934-2ae748635543

Regards.

Reply all
Reply to author
Forward
0 new messages