data node step example / help

2,161 views
Skip to first unread message

Dave

unread,
Oct 19, 2017, 6:39:31 AM10/19/17
to rundeck-discuss
Hi,

Trying to figure out how to use the 'data node step' to populate some data early in the job for other steps to use. Tried properties and json format and tried referencing the data in inline scripts as @data.someKey@ but it's always blank.

Guessing I'm doing this completely wrong but having trouble finding documentation for this and some examples.

For properties type, I assume syntax is:

KEY=VALUE

and for json:

{
  "KEY": "VALUE"
}

and in an inline script / step:

echo "KEY value is: @data.KEY@"

Any guidance would be much appreciated.

Alex Honor

unread,
Oct 31, 2017, 4:54:30 PM10/31/17
to rundeck-discuss
Hi Dave,

Can you explain your use case a bit more?

Steve

unread,
Nov 10, 2017, 10:41:50 AM11/10/17
to rundeck-discuss
Hi Dave

Your problem may be the same as I had.  From the documentation it wasn't clear how to use this. I still don't fully understand all these new data features and didn't realise that you need to turn on this feature within the job.  If you look for "Global Log Filters:" you will find that you need to "add" them.  Add
After I did that I was able to pass data between steps successfully

Step1: echo "RUNDECK:DATA:SteveKey=MyValue"
Step2: echo "@key.SteveKey@"

Cheers
Steve

Cyril SANTUNE

unread,
Dec 1, 2017, 9:04:56 AM12/1/17
to rundeck-discuss
Sorry but do you have an answer for the first question ?
How "data node step" works ? What is its purpose ?
I use "key value data" filter, for me, both features are not linked, am I wrong ?
Is there a way to modify the resources.xml from Rundeck with this step for example ?

senjyu...@gmail.com

unread,
Jan 3, 2018, 2:48:20 PM1/3/18
to rundeck-discuss
I'm having the same issue.
I tried several ways to access the data but no difference.

data.keyname
export.keyname
export.data.keyname

Reference:
https://github.com/rundeck/rundeck/issues/2577
http://rundeck.org/news/2017/11/21/rundeck-2.10.1.html

Does anyone know how to access the data?


2017年12月1日金曜日 6時04分56秒 UTC-8 Cyril SANTUNE:

k t

unread,
Jan 3, 2018, 5:24:52 PM1/3/18
to rundeck-discuss
I figured it out by myself.

You can access the data by @stub.keyname@.
You can check all the variables by using the "Log Data Step"

I think we can use this step to define job scope variable.
You can also use variables in the data step by using ${ctx.key}.

I think Data Step would be much better if rundeck allows something like nested variable.
Example:
@option.@data.key@@ will populate the value of @option.foo@ when @data.key@ is foo.
This doesn't work in the current version 2.10.2.





2018年1月3日水曜日 11時48分20秒 UTC-8 k t:
Reply all
Reply to author
Forward
0 new messages