Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get an option's name in a Rundeck JOB?

Tags:

rundeck

I have a JOB rundeck called "TEST"

I have an option called country

this option retreives a list of key, value from a remote URL as :

[
  {"name":"FRANCE", "value":"FR"},
  {"name":"ITALY", "value":"IT"},
  {"name":"ALGERIA", "value":"DZ"}
] 

I would like to use both of the name and the value in a job step.

echo ${option.country.name} 
echo ${option.country.value} 

But this doesn't work and I'm not able to get the name of the parameter

getting the value can be done using ${option.country}

Is there any trick to get the parameter name ???

like image 282
Stranger B. Avatar asked Dec 13 '25 15:12

Stranger B.


1 Answers

Just for the record answer: Maybe the best approach is to create some script-step that reads the JSON file and extracts the name, also, you can use the same value name like this example (of course is not applicable for all cases).

like image 120
MegaDrive68k Avatar answered Dec 16 '25 23:12

MegaDrive68k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!