#498 open
Josh Wymer

Node hostname (and possibly other variables) not being parsed in external script

Reported by Josh Wymer | December 20th, 2011 @ 03:21 PM

Running the following script on a remote box from rundeck gives incorrect results. It parses node.hostname correctly if pasted in the "script" textbox but does not parse it if it is placed in an external script file.

TEST.SH

echo "host try 1 @node.hostname@"
echo "host try 2 $RD_NODE_HOSTNAME"
echo "host try 3 ${node.hostname}"
RESULTS:
host try 1 @node.hostname@
host try 2
/tmp/1324422636681-my-ip-test.sh: line 254: host try 3 ${node.hostname}: bad substitution

Comments and changes to this ticket

  • Greg Schueler

    Greg Schueler January 3rd, 2012 @ 10:06 AM

    • State changed from “new” to “open”
    • Tag set to “properties, script”
    • Milestone set to “Rundeck 1.4.2”
    • Milestone order changed from “119” to “0”

    the script re-writing was disabled for "external script files" in rundeck 1.4. See issue #440.

    I see that the documentation does not clearly indicate that it has been disabled.

    fyi: @property@ syntax is used for contents of scripts only. $RD_NODE_HOSTNAME is passed as environment variable, but requires that your open SSH server sets AcceptEnv directive in sshd_config. the ${property} syntax is used only on commandline arguments. See http://rundeck.org/docs/RunDeck-Guide.html#script-usage

    So if you set up your test.sh to allow commandline arguments, or your ssh server to allow ENV variables, then you can work around this issue.

    I'll put this issue under 1.4.2 since we either need to update the documentation, or consider allowing @property@ expansion for external script files if indicated with a checkbox (make it optional).

  • Greg Schueler

    Greg Schueler January 26th, 2012 @ 09:43 AM

    • Tag changed from “properties, script” to “enhancement, properties, script”
    • Milestone changed from “Rundeck 1.4.2” to “Rundeck 1.4.3”
    • Milestone order changed from “3” to “0”

    Moving this to 1.4.3 as an enhancement request. I will update the documentation for the 1.4.2 release to clarify things.

  • Greg Schueler

    Greg Schueler May 10th, 2012 @ 10:49 AM

    • Assigned user set to “Greg Schueler”
    • Milestone cleared.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues

Shared Ticket Bins

People watching this ticket

Pages