Re: [rundeck] Getting access to custom node attributes

216 views
Skip to first unread message

Greg Schueler

unread,
May 8, 2013, 6:28:48 PM5/8/13
to rundeck...@googlegroups.com
Hi Dane,

can you explain what you mean by getting access to custom node attributes?

You can use any node attribute in a script or command execution.  For commands or script arguments, you can use ${node.attribute} syntax. Inside a script if you have SSHD configured on the remote node, you can access $RD_NODE_ATTRIBUTE environment variables:  See http://rundeck.org/docs/administration/ssh.html#passing-environment-variables-through-remote-command

Otherwise you can use @node.attribute@ syntax in an inline script to substitute node attributes.


On Wed, May 8, 2013 at 3:12 PM, Dane Uriona <daneu...@gmail.com> wrote:
How are people getting to node attributes during execution?  $RD_NODE_CUSTOM_ATTRIBUTE seems to only be available if you write a NodeExecutor and pass them to each node.  I can't seem to get ssh working in a custom defined NodeExecutor.  I guess I could always pass my custom attributes as args to the scripts I'm running, but that feels like a fragile hack.  Any other ideas?  Or anyone know why my NodeExecutor hangs on my ssh command:

#!/bin/bash

set -e

COMMAND=$RD_EXEC_COMMAND

REMOTE_USERNAME=$RD_NODE_USERNAME

REMOTE_HOSTNAME=$RD_NODE_HOSTNAME

echo "Command: $COMMAND, Node: $REMOTE_USERNAME@$REMOTE_HOSTNAME ($RD_NODE_NAME)"

ssh -v -v -v $REMOTE_USERNAME@$REMOTE_HOSTNAME $COMMAND

exit 0


The echo command works so I know my user@host is correct, but I get no output for the ssh command at all.  Just hangs...  Any insight would be greatly appreciated. 

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages