When trying to create a job which called a script with the
calling convention "scriptname [option1] [option2]", after reading
documentation 1.2.0, section 6.5, I realized that RunDeck does not
handle a default option that is empty. For undefined options (ie in
my case, a normal calling convention), I must update my scripts to
handle RunDeck's expectation that ${option.name} will not be
defined.
I'd like to propose that RunDeck handle an unsupplied optional
option differently. Instead of not defining the option, requiring
any called script to be update, just set the option to nothing.
Perhaps a checkbox saying "Allow option to be empty". This would
allow Rundeck to call existing scripts like my example above which
is pretty standard.
If it did this, then one could configure a job step like
this:
Path: /path/to/script
Commandline arguments: ${option.name}
Then scripts could be run as-is, and not have to be updated to
deal with a nonexistent ${option.name}. If using variable
replacement syntax the model would be to always reference it in
quotes:
#!/bin/sh VAR1="@OPTION.NAME@"
When empty, it would resolve to
VAR1=""
IRC Chat attached