I created an OptionsValue plugin, just for testing. It runs a script, the script sets 3 variables to a random word from a list of words in a file
(example sublime, subside, succumb).The guts of the script does this :
x=`cat /home/rundeck/words | xargs shuf -n1 -e` y=`cat /home/rundeck/words | xargs shuf -n1 -e`
z=`cat /home/rundeck/words | xargs shuf -n1 -e`
RESULTS=("$x" "$y" "$z")
echo "==START_OPTIONS=="
for result in "${RESULTS[@]}";
do
echo "$result:$result" # Using value:label format
done
echo "==END_OPTIONS=="
and that creates a dropdown menu in the Rundeck job of those 3 randomly picked words. Let's call that option ${option.word} ,
And every time I load the Rundeck job, the 3 values change.
So this is good ..
it shows me how I can run a script on the fly to generate the values in a drop down.
So can I pass the value of a previous option (example
${option.ClientCode}) to the script?
I want the script to take in the value
${option.ClientCode} and use it to generate the dropdown for
${option.word}.
I can do this with cascading options, but that relies on a static JSON file, whereas the script is dynamic .. it will go get data base on
${option.ClientCode}.