Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#498

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

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

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Greg Schueler
    Greg Schueler
    • 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 Scriptfiles get munged (don't rewrite them).

    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).

    January 3rd, 2012 @ 10:06 AM

  2. Greg Schueler
    Greg Schueler
    • 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.

    January 26th, 2012 @ 09:43 AM

  3. Greg Schueler
    Greg Schueler
    • Assigned user set to Greg Schueler
    • Milestone cleared.

    May 10th, 2012 @ 10:49 AM

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.